Reputation: 13741
I am trying to use the email package but I keep getting the error:
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)
Here is my click event that calls the email method:
click .saveUserDetails': function(e, tmpl) {
e.preventDefault();
'click .saveUserDetails': function(e, tmpl) {
e.preventDefault();
Meteor.call('sendEmail',
'[email protected]',
'[email protected]',
'Hello from Meteor!',
'user confirmed!');
}
Here is my email environment setup:
Meteor.startup(function() {
process.env.MAIL_URL = 'smtp://[email protected]:[email protected]:25/';
});
And here is my email method:
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
});
} });
Anyone have any idea what might be going on? Thank you in advance!
Upvotes: 3
Views: 889
Reputation: 75955
Your hosting provider/ISP may be blocking SMTP/Port 25.
This is quite common as a method to prevent servers/users being used for sending spam. Try using an alternative port or get in touch with your hosting provider/ISP to remove the restriction.
Upvotes: 3