MeteorJS电子邮件配置SSL

时间:2013-03-06 17:54:54

标签: email ssl meteor

我正在尝试从Meteor JS发送电子邮件,并采用了文档中最简单的方法。但是,发送失败,我得到以下堆栈跟踪:

Exception while invoking method 'sendEmail' Error: connect ETIMEDOUT
at Object.Future.wait (/usr/lib64/meteor/lib/node_modules/fibers/future.js:322:15)
at smtpSend (app/packages/email/email.js:69:43)
at Object.Email.send (app/packages/email/email.js:111:7)
at Meteor.methods.sendEmail (app/server/email.js:7:11)
at _.extend.protocol_handlers.method.exception (app/packages/livedata/livedata_server.js:593:30)
at _.extend.withValue (app/packages/meteor/dynamics_nodejs.js:33:19)
at app/packages/livedata/livedata_server.js:592:46
at _.extend.withValue (app/packages/meteor/dynamics_nodejs.js:33:19)
at _.extend.protocol_handlers.method (app/packages/livedata/livedata_server.js:591:37)
at _.extend.processMessage.processNext (app/packages/livedata/livedata_server.js:484:43)
- - - - -
at errnoException (net.js:770:11)
at Object.afterConnect [as oncomplete] (net.js:761:19)

我通过以下行在服务器文件夹中的bootstrap.js中提供我的电子邮件设置:

process.env.MAIL_URL = "smtp://user@gmail.com:password@smtp.googlemail.com:465"

我很确定我也必须在某处开启SSL,但我不知道如何(我可能只使用Node&#39的email.js)。

1 个答案:

答案 0 :(得分:1)

自己找到 - 不是缺少设置SSL选项,而是MAIL_URL中的第一个'@gmail.com'。正确的行是:

process.env.MAIL_URL = "smtp://user:password@smtp.googlemail.com:465"