How come my Meteor app with accounts package is not sending a verification email?

后端 未结 2 799
伪装坚强ぢ
伪装坚强ぢ 2021-01-02 01:16

I am making a meteor app and I have the mrt accounts-password package added as well as mrt accounts-ui-bootstrap-dropdown.

I have added the loginbuttons so users ca

相关标签:
2条回答
  • 2021-01-02 02:03

    To configure the MAIL_URL, don't forget to add the core email package:

    meteor add email
    

    And then, server-side:

    // server/smtp.js
    Meteor.startup(function () {
      smtp = {
        username: 'your_username',   // eg: server@gentlenode.com
        password: 'your_password',   // eg: 3eeP1gtizk5eziohfervU
        server:   'smtp.gmail.com',  // eg: mail.gandi.net
        port: 25
      }
    
      process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) + ':' + encodeURIComponent(smtp.password) + '@' + encodeURIComponent(smtp.server) + ':' + smtp.port;
    });
    

    Read More: Verify an Email with Meteor Accounts.

    0 讨论(0)
  • 2021-01-02 02:16

    See here: http://docs.meteor.com/#email

    If MAIL_URL is not set (eg, when running your application locally), Email.send outputs the message to standard output instead

    Web servers such as Meteor cannot send emails by themselves, they need a SMTP server to do that. You need to set up one and set it with MAIL_URL variable.

    0 讨论(0)
提交回复
热议问题