Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 mailOptions = { from: environment.smtp.email, to: '[email protected]', subject: 'Subject', html: "Mail content here." }

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"

like image 396
Stepan Rafael Avatar asked Oct 16 '25 06:10

Stepan Rafael


1 Answers

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: '[email protected]', pass: "123456" }, tls: { rejectUnauthorized: false } });

like image 89
Stepan Rafael Avatar answered Oct 19 '25 00:10

Stepan Rafael



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!