Looking for some insight into this error I'm getting.
on smtpTransport.sendmail(func(err, info){})
The err variable returns this:
Error: getaddrinfo ENOTFOUND smtp.gmail.com smtp.gmail.com:465
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
and my code is:
var smtpTransport = nodemailer.createTransport({
service: 'Gmail',
auth: {
user: '[email protected]',
pass: 'xxx'
}
});
var mailOptions = {
to: user.email,
from: '[email protected]',
subject: 'Node.js Password Reset',
text: ' '
};
smtpTransport.sendMail(mailOptions, function(err) {
});
}
], function(err) {
});
Try stop using gmail service and set it up like any other smtpTransport like the following.
var smtpTransport = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 465,
secure: true, // use SSL
auth: {
user: '[email protected]',
pass: 'pass'
}
});
If This does not work, your server might not be able to lookup smtp.gmail.com due to a firewall or something, to check type the following.
nslookup smtp.gmail.com