Nodemailer not working on Amazon EC2 instance

Question:

I am EC2 instance up and running , I wanted to integrate nodemailer in my application. Following the https://www.npmjs.com/package/nodemailer I was able to send email from my localhost. When the same code I integrated on EC2 instance I am getting Invalid login error . Sometime gmail blocks login from other application and send confirm mail to the inbox. I didnt get any such mail also. Do I need to enable some port on EC2 instance or I can use nodemailer at all on EC2 instance. Please suggest

Answer:

Gmail is not a production SMTP service. Configure nodemailer to send mail from a production mailer, such as AWS Simple Email Service. Like gmail, SES is a “well-known service” in nodemailer. There’s a great example of using SES in the nodemailer README.

Leave a Reply