title: nodemailer Invalid login: 535 Authentication Failed
body: <p><strong>I'm trying to use nodemailer(npm package) in my node app to send email through the contact page. It is giving me this 535 Authentication Failed error while I can assure you that my email and password are absolutely correct.</strong></p>
  <pre><code>var express = require('express');
  var router = express.Router();
  const nodemailer = require(&quot;nodemailer&quot;);
  require('dotenv').config();
  
  router.route('/')
      .post((req, res)=&gt;{
          const emailData=req.body;
          let transporter = nodemailer.createTransport({
              host: &quot;smtp.zoho.in&quot;,
              port: 465,
              secure: true, // true for 465, false for other ports
              auth: {
                  user: process.env.EMAIL_ID, // generated ethereal user
                  pass: process.env.EMAIL_PASS, // generated ethereal password
              },
              tls:{
                  rejectUnauthorized: false
              }
          });
          
      let info = transporter.sendMail({
          from: process.env.EMAIL_ID, // sender address
          to: process.env.EMAIL_ID, // list of receivers
          subject: &quot;Quengenesis: Contact Message&quot;, // Subject line
          text: `
              From: ${emailData.fName} ${emailData.lName}
              Email: ${emailData.email}
              Phone: ${emailData.phone}
              Message: ${emailData.message}`, // plain text body
          // html: &quot;&lt;b&gt;Hello world?&lt;/b&gt;&quot;, // html body
      });
      
      // console.log(&quot;Message sent: %s&quot;, info.messageId);
      // console.log(&quot;Preview URL: %s&quot;, nodemailer.getTestMessageUrl(info));
      // verify connection configuration
      transporter.verify(function(err, success) {
          if (err) {
              res.send('There is a problem in the server, please try again later '+ err);
          } 
          else {
              res.send('Your message was sent successfully');
          }
      });
      
  })
  </code></pre>
  <p>module.exports = router;</p>