Send email with JavaScript (client-side) - javascript

So I have this basic contact form that asks for user's name,email and password and as a project I want to send through JavaScript or client-side an email confirmation like "account created" to the client's email input. I have searched numerous sites and stuff and thought it is pretty complicated so I made this question here. Thanks in advance for any answers!

You cannot.
You would need an email server that sends the email to your users.
Setting up an mail server is quite complicated. People usually go with some mailing services like Sendgrid

Related

Firebase - Send Password via Email after User Account Creation

I am working on a college app in which only the administrator has the right to create user accounts. On successful User Account creation, the user gets an email with his user email and password as plain text.
I am already familiar with the email verification and password reset mail in firebase but I am not allowed to do that.
I already looked at answer to this question: Send User Password via Email with Firebase but it is very less helpful as the answer provided is complicated to understand.
So all I want is the password to be sent via email whenever a user is created.
PS: I am working with Web Interface (JavaScript). How do I do that? It would be even nice if I get help with some code chunks included.
You can achieve this using firebase cloud functions following the steps below
Setup Admin SDK following the documentation https://firebase.google.com/docs/admin/setup
Add a Firebase Authentication Listener https://firebase.google.com/docs/functions/auth-events
You can send mail with sendgrid See this article
If you want to really get familiar with cloud functions you can start here

Changing Email subject for outlook

I was asked if changing an email's subject is possible when someone receives it in Outlook. Is it?
I was thinking it may be. The same way user agents are used for browsers maybe? I'm pretty new to emails but searching on the internet didn't help and I've already spent a few hours doing that.
You don't have to solve it for me, just point me to the right direction would suffice. Either way it's something I would like to learn doing.
TL;DR Email subject text change based on recipient (Outlook specifically).
Email clients do not support dynamic code, so you can't do this with client-side JavaScript.
SMTP servers sending email have no way of knowing which client will be used to open the email. (They don't send email in response to the email client asking for it).
What you want is impossible.

Open outlook email search from Java/JavaScript

Recently, I saw a form on SharePoint where user can select/search emails from a widget. It seemed to me that the emails were not locally stored and that SharePoint is somehow getting the emails from Outlook or an email server.
My question here would be that whether something like this is possible in Java/Javascript or not? So that I do not store emails locally and the search widget may bring the emails from an email server.
Thanks a lot.

How to send an email using JS or JQUERY but no MAILTO

Indeed it is an awesome day to everyone but not for me because I've been handling this battle cry for more than 13 days now and cant get it done. I have searched across the web but cant find the solution that can get my butt out of this mess. And yes stackoverflow is always my last resort when things get worse.
Can anyone suggest what is the best way(or even alternative) in sending email using js or jquery ?. Perhaps a simple snippet would do. Thanks!
You cannot send an email within the client browser. If your website is running on your own webserver, you can send a request from within the browser to your server that sends an email. If you're running a node.js server, there are many email apis.
For example, my business is a Mailjet customer, and so I can use the node-mailjet api on my server-side. Also there's https://nodemailer.com/ and similar npm packages.
Sending email only using javascript on client-side is not possible. By that you would give full control to user what and where he sends email - cool spam solution..
I wouldn't recommend to expose service from server that send email to client-side from server-side with full settings of message that will be sent. You don't want to allow spamming.
Only good approach is to predefine email on server and then when triggering action occurs resolve dynamic values in email on server and send email from server. Still you have to ensure user cant spam with some security policy.
So how to get out of this ? Implement service on server that will send emails for you (called with AJAX), lets say by code name and parameters. On server-side, choose template by code-name and resolve it by parameters passed with server request. Implement you security policy so you can be sure user cant spam (for example when user can choose to which email address will be message sent). Then pass it all to SMTP.

Send Email through Javascript/HTML using user client

I know this question has been somewhat answered already in that using client-side scripting does not send emails, but please bear with me. I would like to have a 'send email' form on my website. The thing is that the website will be used by a handful of people who do have an email client installed. So I DO want to use their installed client, but I don't want the client to pop up. Is it possible to have the client do the work and send the email in the background, or must it popup every time?
If it is not possible, can anyone direct me to which server-side scripting language would be the most efficient at emailing a form? And if there are any relevant online tutorials on the matter?
Thanks for your time

Categories