I think the sendVerificationEmail call should be:
Accounts.sendVerificationEmail Meteor.userId()
according to docs http://docs.meteor.com/#/full/accounts_sendverificationemail
If this code is the exact code that you are using, you may have problems due to the order in which each part of the code is executed (callbacks are executed asynchronously). The launch callback is triggered after PrettyEmail.options and Accounts.sendVerificationEmail
If you insert these two sections in the following order, they should work as expected:
if Meteor.isServer Meteor.startup -> process.env.MAIL_URL = 'smtp://sandboxid.mailgun.org: mypassword@smtp.mailgun.org :587' PrettyEmail.options = from: ' primaryemail@gmail.com ' siteName: 'Meteor Test' companyAddress: 'sdfsf, gdfg-df' companyName: 'Code to Create' companyUrl: 'http://example.com' Accounts.sendVerificationEmail Meteor.userId()
Otherwise, it might be worth setting MAIL_URL before starting the application, for example:
MAIL_URL="smtp://sandboxid.mailgun.org: mypassword@smtp.mailgun.org :587" meteor
EDIT: Example code is not secure: If you save this code in the “both” directory, any user accessing your website will be able to see your email credentials. You must put the server code in the server directory, or at least set MAIL_URL outside your code, as shown above.
source share