nodejs用nodemailer发送邮件
安装nodemailer
npm install nodemailer --save
app.js
var nodemailer = require('nodemailer');
//配置邮件
var transporter = nodemailer.createTransport('SMTP',{
host: "smtp.163.com",
secureConnection: true,
port:465,
auth: {
user: 'xxxxxx@163.com',
pass: 'xxxxxx',
}
});
//发送邮件
var sendmail =