当我将此配置用于 Nodemailer 时:
const transporter = nodemailer.createTransport({
service: process.env.EMAIL_SERVICE,
auth: {
user: process.env.EMAIL_USER,
pass: process.env.EMAIL_PASSWORD
}
});
变量:
EMAIL_SERVICE: 'Hotmail',
EMAIL_USER: 'MyEmail@outlook.com',
EMAIL_PASSWORD: 'MyPassword'
我这样发送电子邮件:
transporter.sendMail({
to: email,
subject: 'Confirmar cambio de contraseña',
html: `Para cambiar la contraseña entre a <a href="${url}">${url}</a> <br> Este token solo dura 24 horas.`
});
在开发中它工作得很好但是当我现在部署它时,它会抛出这个错误:
我该如何解决?
这里有一个关于这个的小例子:
https://github.com/MontoyaAndres/NowProblemNodemailer
现在在这里:
https://nowemail-owcypiqzsr.now.sh
谢谢 :)