I try to send a gmail smtp letter, but I get an error message:
My email address and password are correct. I use nodemailer to send mail;
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
service: 'Gmail',
auth: {
admin: 'myuseremail.com',
pass: 'password'
}
});
var mailOptions = {
from: 'sender address',
to: to,
subject: 'Password Reset',
html: 'Your one time password is : <b>' + temporaryPassword + ' </b>'
};
transporter.sendMail(mailOptions, function (error, info) {
console.log(error,info);
}
in the log I get an error:
{
[Error: Invalid login]
code: 'EAUTH',
response: '535-5.7.8 Username and Password not accepted. Learn more at\n535 5.7.8 https://support.google.com/mail/answer/14257 k5sm20957041pdo.48 - gsmtp',
responseCode: 535
}
I try the link, but this does not work:
https://laracasts.com/discuss/channels/general-discussion/help-email-doesnt-get-sent-with-gmail-smtp
source
share