简体   繁体   中英

MeteorJS email configuration SSL

I am trying to send emails from Meteor JS and took the simplest approach found in the documentation. However, sending fails and I get the following stack trace:

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)

I provide my email settings in bootstrap.js in the server folder via this line:

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

I am pretty sure I also have to switch on SSL somewhere, but I do not know how (I could probably use Node's email.js alone).

Found it myself - it was not the lack of setting the SSL option, but the first '@gmail.com' in MAIL_URL. The correct line is:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM