【发布时间】:2014-04-11 15:03:56
【问题描述】:
我正在尝试通过没有 SMTP 传输的 nodemailer 发送电子邮件。所以我做到了:
var mail = require("nodemailer").mail;
mail({
from: "Fred Foo ✔ <foo@blurdybloop.com>", // sender address
to: "******@gmail.com", // list of receivers
subject: "Hello ✔", // Subject line
text: "Hello world ✔", // plaintext body
html: "<b>Hello world ✔</b>" // html body
});
但是当我跑步时,我明白了:
> node sendmail.js
Queued message #1 from foo@blurdybloop.com, to vinz243@gmail.com
Retrieved message #1 from the queue, reolving gmail.com
gmail.com resolved to gmail-smtp-in.l.google.com for #1
Connecting to gmail-smtp-in.l.google.com:25 for message #1
Failed processing message #1
Message #1 requeued for 15 minutes
Closing connection to the server
Error: read ECONNRESET
at errnoException (net.js:901:11)
at TCP.onread (net.js:556:19)
我在 Windows 7 32 上。
编辑 这似乎是一个与 Windows 相关的错误,因为它在 linux 上工作
编辑#2
在 git shell 上,如果我输入 telnet smtp.gmail 587 它会在这里被阻止:
220 mx.google.com ESMTP f7...y.24 -gsmtp
【问题讨论】:
-
确保您已允许通过连接到 gmail smtp 的端口进行连接,首先测试 telnet smtp.gmail.com 587
-
我在 Windows 上,所以
telnet命令不起作用。 -
Windows 用户 :D,您可以启用它social.technet.microsoft.com/wiki/contents/articles/…。或者使用其他一些客户端,比如 Putty。
-
没人有答案吗?我不想浪费 100 声望...
标签: node.js email nodemailer