user2384694 user2384694 - 1 year ago 114
Node.js Question

sending emails in node.js / nodemailer

I tried to use nodemailer to send emails using my gmail account.

However, Google rejects my login as suspicious and thinks I am a hacker.

I tried Yahoo which does send the email.

My questions are:

1) How can I configure nodemailer to send emails thru gmail
2) Standard/Reliable email library in node.js community with good support that can be used in production.

Answer Source

I used emailjs, and haven't had that issue. Not sure if that's because it's email.js or because it's Google Apps vs Gmail, or maybe Google is just less suspicious with this app for some reason. Maybe useful to try to triangulate:

$> npm install emailjs

   emailjs = require('emailjs');


var server = emailjs.server.connect({

          text: message
          from:"Display name <>",
        function (err, message) {   ... }