Node.js发送邮件,报no method 'send'错误
发布于 13 年前 作者 sokos 9876 次预览 最后一次回复是 13 年前 来自
我用node_mailder发送邮件,按照例子的代码,运行之后报“TypeError: Object #<Object> has no method ‘send’”错误。有这方面遇到这样问题的朋友麽?怎么解决的?
Node.js版本v0.6.15,node_mailder版本v0.6.4,以下是完整代码:
var email = require("mailer");
email.send({
host : "smtp.gmail.com",
port : "25",
ssl: true,
domain : "smtp.gmail.com",
to : "****[@gmail](/user/gmail).com",
from : "****[@gmail](/user/gmail).com",
subject : "node_mailer test email",
body: "Hello! This is a test of the node_mailer.",
authentication : "login",
username : "****[@gmail](/user/gmail).com",
password : "****"
},
function(err, result){
if(err){ console.log(err); }
});
1 回复
奇怪了,用 Nodemailer 就发送成功了,具体代码是Example里面的: