我已经设置了这样的电子邮件发送:
nodemailer = require("nodemailer");
...
nodemailer.SMTP = {
host: 'smtp.gmail.com', // required
port: 465, // optional, defaults to 25 or 465
domain: 'smtp.gmail.com', // domain used by client to identify itself to server
authentication: 'login', // optional, false by default
user: '1*******@gmail.com', // used only when use_authentication is true
pass: '*******' // used only when use_authentication is true
}
// send an e-mail
nodemailer.send_mail(
// e-mail options
{
sender: '1*******@gmail.com',
to:'2*******@gmail.com',
subject:'Hello!',
html: '<p><b>Hi,</b> how are you doing?</p>',
body:'Hi, how are you doing?'
},
// callback function
function(error, success){
console.log('Message ' + success ? 'sent' : 'failed');
}
回调函数记录“已发送”,但从未发送过电子邮件。我按照本教程http://www.thihaz.com/?p=218
我必须另外设置吗?