I've searched this site for an answer that worked and have found nothing.
I'm trying to setup nodemailer and keep receiving this error:
{"code":"EENVELOPE","command":"API"}
Here's the setup code. I've tried with and without TLS
(port: 465
and port: 587
with both combinations of secure: true
and secure: false
)
nodejs code:
function(resetToken, user, done) {
let smtpConfig = nodemailer.createTransport({
host: 'mail.privateemail.com',
port: 587,
secure: false,
auth: {
user: 'email',
pass: 'pass'
}
});
let mailOptions = {
to: user.email,
from: 'email',
subject: 'Password Reset For app',
text: 'Reset this'
};
smtpConfig.sendMail(mailOptions, function(err, info) {
if(err) {
res.json({
'message': err,
'info': info
});
}
res.json({
'message': 'Click the link in the email we just sent to reset your password'
});
});
}
So it works just fine for me. This is my setup
And it works on secure port too.(465)