Оригинальный репозиторий с github
Change setting on ypur account
- enter in google account
- set up 2-step verification
- generate app password
pic2 this password will be used as a login
- correct your mail setting
let transporter = nodeMailer.createTransport({
host: 'smtp.googlemail.com',
port: 465,
secure: true,
auth: {
user: '[email protected]',
pass: 'your app password'
});
- correct your sender name
let mailOptions = {
from: '"your-sender name" <[email protected]>', // sender address
to: req.body.to, // list of receivers
subject: req.body.subject, // Subject line
text: req.body.body, // plain text body
html: '<b>NodeJS Email Tutorial</b>' // html body