【发布时间】:2012-05-06 12:42:38
【问题描述】:
我正在尝试使用 node_mailer 来使用 gmail smtp。我的 nodejs 日志中出现以下错误(使用 nodester)。这是我的代码:
var email = require('mailer');
email.send({
host : "smtp.gmail.com",
port : "465",
ssl : true,
domain : "domain.com",
to : "emailId@gmail.com",
from : "email@gmail.com",
subject : "You have been registered",
body: "<B>Hello! This is a test of the node_mailer.</B>",
authentication : "login", // auth login is supported; anything else is no auth
username : /* username */,
password : /* password */
},
function(err, result){
if(err){ self.now.error(err); console.log(err); return;}
else this.now.successfullySent(result);
});
我在堆栈中没有收到任何错误,但电子邮件未送达。
@work4liberty 和@David Ellis。感谢您的两个输入,但似乎问题不在于我的服务器代码,我从客户端 javascript 中发送了错误的 emailId 值。 Nodemailer 确实帮助我调试了错误的正确文本。
【问题讨论】:
-
请正确缩进代码