Meteor电子邮件ETIMEOUT错误

时间:2015-04-18 13:29:11

标签: javascript email meteor

我正在尝试使用电子邮件包,但我一直收到错误:

Exception while invoking method 'sendEmail' Error: connect ETIMEDOUT
I20150418-09:24:22.233(-4)?     at Object.Future.wait (/Users/tinzors/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:398:15)
I20150418-09:24:22.233(-4)?     at smtpSend (packages/email/email.js:76:1)
I20150418-09:24:22.234(-4)?     at Object.Email.send (packages/email/email.js:153:1)
I20150418-09:24:22.234(-4)?     at [object Object].Meteor.methods.sendEmail (app/server/methods/email.js:10:11)
I20150418-09:24:22.234(-4)?     at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1617:1)
I20150418-09:24:22.234(-4)?     at packages/ddp/livedata_server.js:648:1
I20150418-09:24:22.234(-4)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20150418-09:24:22.234(-4)?     at packages/ddp/livedata_server.js:647:1
I20150418-09:24:22.234(-4)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20150418-09:24:22.234(-4)?     at [object Object]._.extend.protocol_handlers.method (packages/ddp/livedata_server.js:646:1)
I20150418-09:24:22.234(-4)?     - - - - -
I20150418-09:24:22.234(-4)?     at errnoException (net.js:905:11)
I20150418-09:24:22.234(-4)?     at Object.afterConnect [as oncomplete] (net.js:896:19)

以下是我调用电子邮件方法的点击事件:

click .saveUserDetails': function(e, tmpl) {
    e.preventDefault();


    'click .saveUserDetails': function(e, tmpl) {
    e.preventDefault();
    Meteor.call('sendEmail',
               'demoemail@gmail.com',
               'demoemail@gmail.com',
               'Hello from Meteor!',
               'user confirmed!');
}

这是我的电子邮件环境设置:

Meteor.startup(function() {
process.env.MAIL_URL = 'smtp://demoemail@gmail.com:stackoverflowpw@smtp.gmail.com:25/';
});

这是我的电子邮件方法:

Meteor.methods({
 sendEmail: function (to, from, subject, text) {
 check([to, from, subject, text], [String]);

this.unblock();

Email.send({
  to: to,
  from: from,
  subject: subject,
  text: text
});

} });

任何人都知道可能会发生什么?提前谢谢!

1 个答案:

答案 0 :(得分:3)

您的托管服务提供商/ ISP可能阻止SMTP /端口25。

这是一种防止服务器/用户用于发送垃圾邮件的方法。尝试使用备用端口或与您的托管服务提供商/ ISP取得联系以取消限制。