node.js how can i do 530 error in smtp-server

How do I fix 530 authentication required? There's two ways to solve this problem. Either configure your email client to use SMTP authentication. This setting is normally found in the account settings in your email client. Or, disable SMTP authentication for the IP range.

node.js how can i do 530 error in smtp-server

I sincerely hope this is a bug and not just me being stupid. I cannot explain the issue - I am getting repeated 530 5.5.1 errors while using Zoho. The error occurs when I try to send an email like the following. I have also tried on port 587, removing the type: 'login' and more. The login values ARE being passed to the transporter and using transporter.validate raises no issues.

const transporter = nodemailer.createTransport({
    host: "smtp.zoho.eu",
    post: 465,
    secure: true,
    auth: {
      type: "login",
      user: process.env.NO_REPLY_EMAIL_ADDRESS,
      pass: process.env.NO_REPLY_EMAIL_PASSWORD
    }
  });

  let emailData = {
    from: process.env.NO_REPLY_EMAIL_ADDRESS,
    to: '<email>',
    subject: "Email verification code for your account",
    html: `<h1> Your Verification code </h1>\n<p> Code:  </p>`
  };
  transporter.sendMail(emailData, function(err, response) {
    console.log(err);
  });

However, I can send emails using smtper.net, with the same (correct details) and same configuration, as seen below, so I can only think this is a Nodemailer issue
image

Full Error:

{ Error: Mail command failed: 530 5.5.1 Authentication Required.
    at SMTPConnection._formatError (C:\Users\NAME\Desktop\Projects\Web Development\PROJECT\code\node_modules\nodemailer\lib\smtp-connection\index.js:777:19)
    at SMTPConnection._actionMAIL (C:\Users\NAME\Desktop\Projects\Web Development\PROJECT\code\node_modules\nodemailer\lib\smtp-connection\index.js:1546:34)
    at SMTPConnection._responseActions.push.str (C:\Users\NAME\Desktop\Projects\Web Development\PROJECT\code\node_modules\nodemailer\lib\smtp-connection\index.js:1028:18)
    at SMTPConnection._processResponse (C:\Users\NAME\Desktop\Projects\Web Development\PROJECT\code\node_modules\nodemailer\lib\smtp-connection\index.js:935:20)
    at SMTPConnection._onData (C:\Users\NAME\Desktop\Projects\Web Development\PROJECT\code\node_modules\nodemailer\lib\smtp-connection\index.js:742:14)
    at TLSSocket.SMTPConnection._onSocketData.chunk (C:\Users\NAME\Desktop\Projects\Web Development\PROJECT\code\node_modules\nodemailer\lib\smtp-connection\index.js:195:44)
    at TLSSocket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at TLSSocket.Readable.push (_stream_readable.js:224:10)
    at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
  code: 'EENVELOPE',
  response: '530 5.5.1 Authentication Required.',
  responseCode: 530,
  command: 'MAIL FROM' }

Log:

2019-12-07 12:29:00] DEBUG [v9bHY3Fgcbw] Resolved smtp.zoho.eu as 87.252.213.164 [cache miss]
[2019-12-07 12:29:00] INFO  [v9bHY3Fgcbw] Secure connection established to 87.252.213.164:465
[2019-12-07 12:29:00] DEBUG [v9bHY3Fgcbw] SMTP handshake finished
[2019-12-07 12:29:00] INFO  Sending message <REDACTED@REDACTED.com> to <REDACTED@gmail.com>
[2019-12-07 12:29:00] DEBUG [v9bHY3Fgcbw] Closing connection to the server using "end"
[2019-12-07 12:29:00] ERROR Send error for <REDACTED@REDACTED.com>: Mail command failed: 530 5.5.1 Authentication Required.
[2019-12-07 12:29:00] ERROR Send Error: Mail command failed: 530 5.5.1 Authentication Required.
{ Error: Mail command failed: 530 5.5.1 Authentication Required.
    at SMTPConnection._formatError (C:\Users\NAME\Desktop\Projects\Web Development\PROJECT\code\node_modules\nodemailer\lib\smtp-connection\index.js:777:19)
    at SMTPConnection._actionMAIL (C:\Users\NAME\Desktop\Projects\Web Development\PROJECT\code\node_modules\nodemailer\lib\smtp-connection\index.js:1546:34)
    at SMTPConnection._responseActions.push.str (C:\Users\NAME\Desktop\Projects\Web Development\PROJECT\code\node_modules\nodemailer\lib\smtp-connection\index.js:1028:18)
    at SMTPConnection._processResponse (C:\Users\NAME\Desktop\Projects\Web Development\PROJECT\code\node_modules\nodemailer\lib\smtp-connection\index.js:935:20)
    at SMTPConnection._onData (C:\Users\NAME\Desktop\Projects\Web Development\PROJECT\code\node_modules\nodemailer\lib\smtp-connection\index.js:742:14)
    at TLSSocket.SMTPConnection._onSocketData.chunk (C:\Users\NAME\Desktop\Projects\Web Development\PROJECT\code\node_modules\nodemailer\lib\smtp-connection\index.js:195:44)
    at TLSSocket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at TLSSocket.Readable.push (_stream_readable.js:224:10)
    at TLSWrap.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
  code: 'EENVELOPE',
  response: '530 5.5.1 Authentication Required.',
  responseCode: 530,
  command: 'MAIL FROM' }
[2019-12-07 12:29:00] INFO  [v9bHY3Fgcbw] Connection closed

Again, I hope this isn't some mis-configuration on my part, but being able to use SMTPer makes me believe this is a Nodemailer issue. Thanks for any help.


Click Here to Visit

What's Your Reaction?

like
0
dislike
0
love
0
funny
0
angry
0
sad
0
wow
0