Im trying to send a email using node.js - nodemailer module , my whole code looks like
var http=require(\"http\");
var nodemailer=require(\"nodemailer\");
h
it's works with me after using none-secure port
var transporter = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 587,
secure: false, // secure:true for port 465, secure:false for port 587
auth: {
user: 'xxxx@gmail.com',
pass: 'xxxx'
}
});
Try installing nodemailer-smtp-transport and then use it inside your createTransport function.
var smtpTransport = require('nodemailer-smtp-transport');
var transport = nodemailer.createTransport(smtpTransport({
service: 'gmail',
auth: {
user: 'myemail@gmail.com', // my mail
pass: 'mypassword'
}
}));
And try also while in your google account enabling this: https://www.google.com/settings/security/lesssecureapps
I really think this should be your auth problem