使用nodemailer,以QQ邮箱发送邮件踩到的坑
作者:互联网
根据nodemailer官网的配置进行配置
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
host: "smtp.qq.email", // 邮箱后缀
port: 587,
secure: false, // true for 465, false for other ports
auth: {
user: 'xxxxxxxxx@qq.com', // generated ethereal user(邮箱账号)
pass: 'xxxxxxxxx' // generated ethereal password(邮箱密码)
}
});
// send mail with defined transport object
let info = await transporter.sendMail({
from: '"Fred Foo 标签:QQ,nodemailer,generated,user,ethereal,pass,邮箱
来源: https://blog.csdn.net/D1sappearRy/article/details/103953201