【发布时间】:2015-08-16 10:00:06
【问题描述】:
我正在尝试使用 emailjs (https://github.com/eleith/emailjs) 通过 nodejs 发送电子邮件,但是,它给了我一个错误:{ [Error: timedout while connected to smtp server] code: 4, smtp: undefined }
我正在尝试使用 hotmail,但我可以使用其他,我只希望它工作。请问有什么办法吗?
var email = require("emailjs");
var server = email.server.connect({
user: "xxx@hotmail.com",
password:"xxxyyyy",
host: "smtp-mail.live.com",
ssl: true
});
// send the message and get a callback with an error or details of the message that was sent
server.send({
text: "i hope this works",
from: "you <xxxxxx@hotmail.com>",
to: "someone <zzzzz@hotmail.com>",
//cc: "else <else@your-email.com>",
subject: "testing emailjs"
}, function(err, message) { console.log(err || message); });
【问题讨论】:
-
该错误表明这是一个简单的连接信息错误,或者您的网络有问题,除非您还提供了为邮件服务器提供的服务器连接信息(当然没有信用)
-
见这里:github.com/eleith/… 你确定你需要 ssl,而不是 tls?
-
此链接代码也不起作用。
标签: javascript node.js email web smtp