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

 

posted @ 2017-01-15 17:56  webbky  阅读(203)  评论(0编辑  收藏  举报