首页 > 技术文章 > nodejs nodemailer中间件

wanghaonull 2017-01-15 17:56 原文





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); } });

 

推荐阅读