nodejs nodemailer中间件


var stransporter = nodemailer.createTransport({
host:smtp-163.com', //适合163
secureConnection: true, // use SSL
port: 465, // port
auth: {
user: 'bsspirit@gmail.com',
pass: 'xxxxxxxxx'
}
}); function ssl(){
var mailOptions = {
from: 'bsspirit ',
to: 'xxxx@163.com',
subject: 'SSL Email',
html: 'Hello world'
}
return mailOptions;
} stransporter.sendMail(ssl(), function(error, info){
if(error){
console.log(error);
}else{
console.log('Message sent: ' + info.response);
}
});
上一篇:java static静态方法的并发性


下一篇:从壹开始前后端分离 [ Vue2.0+.NET Core2.1] 十五 ║Vue基础:JS面向对象&字面量& this字