Search code examples
meteormeteor-accounts

How to send verification email using userAccounts,accounts-password in meteor


I am trying to set up email verification once the user is registered in my app but I receive "Internal Server Error"

Here is my code to create signup form

 <template name="LoginModal">

    {{#if $not currentUser }}

        {{> atForm}}



   {{/if}}
  </template>
//code inside the client folder to configure email verification
   AccountsTemplates.configure({
   confirmPassword:false,
   termsUrl:'terms-of-use',
   privacyUrl:'privacy',
   sendVerificationEmail: true,
   enforceEmailVerification:true,

  forbidClientAccountCreation: true

  });

//Here is my route to load the signup form
 Router.route('/admin/addUser',{

     action: function () {
    BlazeLayout.render('master_layout',       
     {body:'LoginModal',dashboard:'UserDashboard',pageHeader:'AddUserHeader'});
  }
});
 //No any other routes for sign up has been configured.

//The error I receive

(Mail not sent; to enable sending, set the MAIL_URL environment variable.)
I20170311-20:56:01.885(5.5)? MIME-Version: 1.0
I20170311-20:56:01.886(5.5)? Date: Sat, 11 Mar 2017 15:26:01 +0000
 I20170311-20:56:01.887(5.5)? From: "Meteor Accounts" <[email protected]>

How can I set up this to send an email to the created user's email.Where should I write the sender's email address?


Solution

  • meteorpedia

    Meteor.startup(function () {
      process.env.MAIL_URL = 'smtp://postmaster%40meteorize.mailgun.org:[email protected]:587';
    });