Send Emails in Node.js | NodeMailer Tutorial
HTML-код
- Опубликовано: 10 янв 2023
- 👉 Source code: openjavascript.info/2023/01/1...
🎓 NEW: Earn a professional certificate in web development from Meta Inc. (course links in card below) 👇
⚡ Need hosting for a website, WordPress blog or Node.js app? We use HostWithLove: bit.ly/3V2RM9Q ❤️
This tutorial shows you how to send emails in Node.js using the NodeMailer package. Includes how to send an email to multiple addresses and add attachments.
#email #emails #nodejs #nodejstutorial #nodemailer #smtp #javascript
Gmail SMTP server details: support.google.com/mail/answe...
⚡Web development professional certificates from Meta Inc.⚡
Front-End Developer Professional Certificate: imp.i384100.net/b3dMek
Back-End Developer Professional Certificate: imp.i384100.net/gbYorg
iOS Developer Professional Certificate: imp.i384100.net/Jr7qj2
Meta Android Developer Professional Certificate: imp.i384100.net/oeYnGo
Meta Database Engineer Professional Certificate: imp.i384100.net/BX7KGB
Thanks for watching!
👉 Source code: openjavascript.info/2023/01/10/nodemailer-tutorial-send-emails-in-node-js/
Thank you so much for this video. It really helped me out a lot!
That's great to hear! Always happy to hear somone has found a tutorial useful :)
❤❤
Thank you sir!!
NICE! thanks
You're welcome, glad you liked it!
Thank you very much Sir
Hello, thank you for this video.
I've had no problem to make it work on my computer but when I'm putting it on production the server returns an error 535 'authentification error' command: 'AUTH PLAIN', I've tried a lot of things but it's still the same issue.
Have you got some clue of what is happening?
so easy when doing it locally. Once you try to deploy it that's when you get into issues
Nice video
Thanks bro
Thanks, would be helpful
Yes, can definitely be extremely useful to know how to do this :)
thank you very much please make a tutorial with imap :)
You are welcome and thanks for the tutorial suggestion! Putting it on the ideas list :)
can i do this in react also?
is there any way to send large no emails to my customers?
Sir, it’s work fine in dev, but not sending emails in production, what to do ?
when deploy this program in c panel email not sent
emailjs plan offer 200 request for every month or just for one time 200 requests?
Hey i have used your codes but for gmails it says queued.
Hello, how can I message you directly?
the pass inside the auth is the login pass? or something that the SMPT2GO provides?
The pass is the regular password for your email account, though for some services such as Gmail you now have to use an 'app password' for security reasons. You can do this for Gmail in the security section on your main account after enabling two-factor authentication.
Hi is there any tutorial how to send attachment via file input?
I have a tutorial on how you can get a file in Node.js from a file input on the frontend:
ruclips.net/video/TZvMLWFVVhE/видео.html
Then you can send the received file as the attachment instead.
How do you go about with the "less secure app access " feature that was removed from May 2022?
Same doubt
Seems that for Gmail now, you need to enable two-factor authentication on your Google account and, after that, generate an app password (you should be able to manage all of this in the security section of your account). Then, use this password instead of your regular one in Nodemailer.
@@360-jatin6 See my response to the first comment
@@OpenJavaScript Works fine, thank you!!
@@idrin6799 Nice, you're welcome!
how are you able to use your custom domain instead of a gmail domain?
In case you don't have one already, you'd need to purchase a domain. These can be quite cheap if you don't want an in-demand one (I just checked and see domains falling into this category selling for $15 per year).
Then you'd need a server connected to that domain. For this, I'd recommend shared hosting as this can be an afforable solution as long as you are not planning on running a heavy-bandwidth service.The hosting provider I currently use (also in the video example) is HostWithLove: bit.ly/3V2RM9Q
You can also purchase a domain through HostWithLove and ask them to connect it to your hosting if you decide to go with them.
@@OpenJavaScript Thanks for the tutorial and sharing your hosting provider. Hope they'll be able to host my node app. cheers))
hello, sending to multiple recipient puts all addresses in the 'To' field, please how can they to individual recipient
ok got it, i changed to bcc
Nice, thanks for posting the solution so maybe someone with the same issue comes across this :)
thank you
How can i get my company's SMTP server hostname?? Plz help
If you have cPanel access, you can get it by accessing an email account through it and then -> Webmail Home -> Configure Mail Client.
You should be able to see the SMTP server information there.
bro when i use this in vps server, it shows error like : Error: Missing credentials for "PLAIN", what can i do for that
I'm not certain but some things you can try that may help but are NOT secure, deployment applicable solutions:
- Try disabling adblocker when testing
- Add the following property to the transporter (warning: allows your app to connect to untrusted sites without a certificate):
tls: { rejectUnauthorized: false }
Also, make sure your source code matches mine by using the one posted here:
openjavascript.info/2023/01/10/nodemailer-tutorial-send-emails-in-node-js/
@@OpenJavaScript bro i did a mistake that i didnt have my .env on my server 😂😂
@@GaganDeepSingh-mg8hl OK, glad to hear it's resolved!
try const transporter = nodeMailer.createTransport({
host: process.env.MAIL_HOST ,
port: 587,
auth: {
user: process.env.MAIL_USER,
pass: process.env.MAIL_PASSWORD
},
tls: {
rejectUnauthorized: false,
minVersion: "TLSv1.2"
}
});
In create transport function you should pass in auth object instead of password