node.jsreactjsnodemailermailgun

Error: Invalid login: 535 Authentication failed when using Mailgun


How to fix below error when trying to send mail using nodemailer?

I was trying to find solution on internet. but all answers not working for my situation.

Similar question : nodemailer Invalid login: 535 Authentication Failed

Coz I am using mailgun platform.

sendRawEmail Error: Invalid login: 535 Authentication failed
at SMTPConnection._formatError (/app/node_modules/nodemailer/lib/smtp-connection/index.js:790:19)
at SMTPConnection._actionAUTHComplete (/app/node_modules/nodemailer/lib/smtp-connection/index.js:1542:34)
at SMTPConnection.<anonymous> (/app/node_modules/nodemailer/lib/smtp-connection/index.js:546:26)
at SMTPConnection._processResponse (/app/node_modules/nodemailer/lib/smtp-connection/index.js:953:20)
at SMTPConnection._onData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:755:14)
at TLSSocket.SMTPConnection._onSocketData (/app/node_modules/nodemailer/lib/smtp-connection/index.js:193:44)
at TLSSocket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:315:12)
at readableAddChunk (node:internal/streams/readable:289:9)
at TLSSocket.Readable.push (node:internal/streams/readable:228:10) {
code: 'EAUTH',
response: '535 Authentication failed',
responseCode: 535,
command: 'AUTH PLAIN'

I checked all info SMTP, SMTP_USER, SMTP_PASS, SMTP_PORT several times. They are all correct.


Solution

  • I found solution with reset password.

    Maybe it is mailgun bug. After generate new password, it started to work well. I hope this help others who use mailgun.