Sending Email via Accounts-ui?


#1

I’m using Accounts.createuser() to create a new user in my accounts user interface. The user is being created successfully.

I’m running Accounts.config({sendVerificationEmail: true, forbidClientAccountCreation: false}); when Meteor launches in order to have a confirmation email sent to the user. But when I created a test user account for myself, I did not receive an email.

Is there something else I need to do in order to have the dev system send the email?


#2

Have you set the MAIL_URL environment variable?


#3

Thanks, Rob. I had not yet set that up. I am now setting it via:

process.env.MAIL_URL = 'smtp://myUserName:myPassword@myWebHost.com:465/';

I’m getting an internal server error on my call to Accounts.createUser. Are there any tips for how I can debug an error message from the email package?


#4

Hmmmm… I’m running in localhost on my dev machine. Do I need to configure MAIL_URL differently while in localhost?


#5

It should be set the same way.

Having said that, I’ve never tried using process.env.MAIL_URL =. Some of those environment variables are only honoured if they’re set outside of meteor in the environment. So (in development), something like:

MAIL_URL=smtp://myUserName:myPassword@myWebHost.com:465/ meteor

or

export MAIL_URL=smtp://myUserName:myPassword@myWebHost.com:465/
meteor

#6

Thanks for the info. I found a place in Webstorm, the IDE I am using, where I can set environment variables upon app launch. I’m still getting the internal server error on my call to Accounts.createUser. It’s time for me to study up on debugging calls to the mail package. :slight_smile: