Error: Invalid login: 535 Authentication Failed 0|server | at file:///var/www/html/AHFits/Controllers/mailer.js:70:35 0|server | at process.processTicksAndRejections (node:internal/process/task_queues

Error: Invalid login: 535 Authentication Failed 0|server | at file:///var/www/html/AHFits/Controllers/mailer.js:70:35 0|server | at process.processTicksAndRejections (node:internal/process/task_queues

  • I tried every thing anable 2 factor auth, generate app specific password, add MX,SPK,DKIM everything i can do but still I am unable to user email through nodemailer. I work on development but when it Runs on production(VPS) I got  535 Authentication Failed error. why that
This is the code: 
const transporter = nodemailer.createTransport({
 
    host: "smtp.zoho.com",
    port: 465,
    secure: true,
    auth: {
        user: process.env.USER,
        pass: process.env.APP_PASSWORD,
    },
});