Illian
Illian

Reputation: 46

Zoho Mail with Nodemailer - 535 Authentication Error

I have been trying for quite some time to get Nodemailer to successfully send emails using my Zoho Mail account, and I always seem to be getting a 535 Authentication Error despite the solutions I try.

Here is the relevant information about the issue:

  1. I am able to send emails with a test Zoho Mail account without issue.
  2. I am able to login to my main Zoho mail account via browser (it is definitely not an incorrect credentials issue).
  3. I receive a 535 authentication error when switching details to the main Zoho Mail account on Nodemailer.
  4. I have tried, after looking for solutions, to use an app-specific password generated by Zoho themselves, but still get the same error. (See https://stackoverflow.com/a/54084886/3474437 .)
  5. I have tried to change the host address (smtp.zoho.com, zmtp.zoho.eu, zmtp.zoho.in) without success.

I am not sure what else I can do to get the issue solved and I would be appreciative of any help. Thank you in advance.

Upvotes: 0

Views: 480

Answers (2)

adxxtya
adxxtya

Reputation: 849

If you're from India, use smtppto.zoho.in, it would look something like this

const transporter: Transporter = nodemailer.createTransport({
  service: "smtppro.zoho.in",
  host: "smtppro.zoho.in",
  port: 465,
  secure: true,
  auth: {
    user: process.env.NEXT_PUBLIC_ZOHO_MAIL_ID,
    pass: process.env.NEXT_PUBLIC_ZOHO_MAIL_PASSWORD,
  },
});

Upvotes: 1

Illian
Illian

Reputation: 46

It turned out that a professional Zoho mail account may need a different host domain. In my case, this was smtppro.zoho.eu.

So I had to use this in the transported created with node-mailer.

const transporter = nodemailer.createTransport({
  host: 'smtppro.zoho.eu',
  service: 'smtppro.zoho.eu',
  secure: true,
  port: 465,
  auth: {
    user: [redacted],
    pass: [redacted],
  },
});

Upvotes: 0

Related Questions