const nodemailer = require("nodemailer");
let transporter = null;
async function createMailServer() {
transporter = nodemailer.createTransport({
host: "smtp.qq.com",
secure: true, // true for 465, false for other ports
auth: {
user: "xxxx@qq.com", // generated ethereal user
pass: "", // generated ethereal password
}
});
transporter.verify((err) => {
if (err) console.log("邮件服务连接失败", err)
else console.log("邮件服务连接成功 标签:node,err,nodemailer,js,html,transporter,message,邮件 From: https://blog.51cto.com/u_15964288/6055863