Nodemailer,Heroku,Gmail,无效login – 在本地工作

过去几个星期我一直有这个问题,每次都在本地工作,但是一旦我将其部署到我的heroku服务器,它会给我一个invalid login错误。 我已经进入帐户,并获得安全性较低的应用程序。 证书是正确的,并且它每次都在localhost上运行。 有什么我失踪?

 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 <mysmtpemail123@gmail.com>', 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); } }) }