I am trying to send a email in meteor with process.env and smtp gmail

前端 未结 3 1657
说谎
说谎 2020-12-30 11:09

I am using the following to send emails which works on localhost but not my server.

// server
Meteor.startup(function () {
    process.env.MAIL_URL=\"smtp://         


        
3条回答
  •  一个人的身影
    2020-12-30 11:36

    You need to URL encode your username and password else Meteor confuses the two '@' signs with each other.

    You could do this in your JS console (with encodeURIComponent(username)) and usually end up with something like

    user%40gmail.com:password@smtp.gmail.com:465
    

    You could use Mailgun in the same way, or Mandrill, or any other smtp provider. It's just the username format causing the issues.

提交回复
热议问题