Nodemailer Missing credentials for “PLAIN”
Nodemailer Missing credentials for “PLAIN”
Nodemailer was working correctly for a few months with exactly the same configuration.
var smtpTransport = nodemailer.createTransport(
service: "Zoho",
auth:
user: environment.smtp.email,
password: environment.smtp.password
,
secure: false,
tls:
rejectUnauthorized: false
);
var smtpTransport = nodemailer.createTransport(
service: "Zoho",
auth:
user: environment.smtp.email,
password: environment.smtp.password
,
secure: false,
tls:
rejectUnauthorized: false
);
var mailOptions =
from: environment.smtp.email,
to: 'some@email.com',
subject: 'Subject',
html: "Mail content here."
var mailOptions =
from: environment.smtp.email,
to: 'some@email.com',
subject: 'Subject',
html: "Mail content here."
smtpTransport.sendMail(mailOptions, function(error, response)
console.log(error)
);
smtpTransport.sendMail(mailOptions, function(error, response)
console.log(error)
);
It throw " Missing credentials for "PLAIN" ". I have used this config in many places in the app and now it throw this error everywhere. But was working well when I have write the code first time.
"nodemailer": "^4.0.1"
1 Answer
1
Here is the config settings. The 'host' field was missing and it seems to be mandatory in the Nodemailer V3 and above.
https://nodemailer.com/smtp/
var smtpTransport = nodemailer.createTransport(
host: "smtp.zoho.com",
service: "Zoho",
port: 25,
secure: false,
auth:
user: 'some@email.com',
pass: "123456"
,
tls:
rejectUnauthorized: false
);
var smtpTransport = nodemailer.createTransport(
host: "smtp.zoho.com",
service: "Zoho",
port: 25,
secure: false,
auth:
user: 'some@email.com',
pass: "123456"
,
tls:
rejectUnauthorized: false
);
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.