title: Nodemailer, Heroku, Gmail, invalid login - works locally
body: <p>I have been having this issue for the past couple of weeks, it works every time locally, however once I deploy it to my heroku server, it will give me an <code>invalid login</code> error. I have gone into the account and givin access to less secure apps. And the credentials are correct, and it works on localhost every time. Is there something I am missing?</p>
  
  <pre><code>quickSendMail: function(routeBody, callback) {
  //configuring the nodemailer for email notifications
    var smtpConfig = {
            host: 'smtp.gmail.com',
            port: 465,
            secure: true, // use SSL
            auth: {
                user: 'mysmtpemail123',
                pass: '******'
              }
          };
  
    var mailOptions = {
            from: 'SageStorm Site &lt;mysmtpemail123@gmail.com&gt;',
            to: ['my email'],
            subject: routeBody.subject,
            html: 'my message'
          };
  
    var transporter = nodemailer.createTransport(smtpConfig);
  
    transporter.verify(function(error, success) {
          if (error) {
                  console.log(error);
          } else {
                  console.log('server is ready to send emails');
            }
          })
    transporter.sendMail(mailOptions, function(error, info) {
          if (error) {
                console.log(error);
                return callback(err, null);
          } else {
                console.log('Message sent: ' + info.response);
                return callback(null, info);
            }
          })
      }
  </code></pre>