API
配置
QQ企业邮箱
{
service:'qq',
auth: {
user: '',
pass: ''
}
})
其它SMTP邮箱 请参考 https://github.com/andris9/nodemailer-smtp-transport#usage
{
host: 'smtp.exmail.qq.com',
port: 465,
secure: true,
auth: {
user: config.username,
pass: config.password
}
})
发送邮件
发送文本 sendText
var mail = require('shoots-mail')(mailOptions);
var result=yield mail.sendText(from,to,subject,text);
发送超文本 sendHtml
var mail = require('shoots-mail')(mailOptions);
var result=yield mail.sendHtml(from,to,subject,html);