Node.js使用Nodemailer发送邮件
安装Nodemailer
npm install nodemailer --save
调用代码
const nodemailer = require('nodemailer'); //开启一个SMTP连接池
const smtpTransport = nodemailer.createTransport('SMTP', {
thost: 'smtp.qq.com', //主机
tsecureConnection: true, //使用SSL
tport: 465, // SMTP端口
tauth: {
ttuser: 'xxxxx@qq.com', //账号
t}
});
28.06KB
文件大小:
评论区