I connected my domain to a Zoho mail account. Then I was trying to fill in the account data in my env file to use Nodemailer contact form in Next.js application.
Before that all the contact form worked with my google account.
I created the app password and made sure MFA is enabled.
SMTP_HOST="smtppro.zoho.com"
SMTP_PORT="587"
SMTP_USER="mail@mydomain.com"
CONTACT_EMAIL="mail@mydomain.com"
SMTP_PASSWORD="my app password"
My transporter looks like this:
const transporter = nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: Number.parseInt(process.env.SMTP_PORT || "587"),
secure: process.env.SMTP_PORT === "465",
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASSWORD,
},
});
I keep getting the error: {"success":false,"error":"Invalid login: 535 Authentication Failed"}
How could I fix this, cause I've tried all solutions that are on the internet.