Meteor Email process.env.MAIL_URL error


I’m trying to send emails with mailgun.
The method is correct as I have previously tested with gmail (but I can’t use gmail for this project).

I’m getting the following error:

Exception while invoking method ‘sendEmail’ AuthError: Invalid login - 535 5.7.0 Mailgun is not loving your login or password

I have set my process.env.MAIL_URL as so:

Meteor.startup(function () {
process.env.MAIL_URL = ‘smtp://’;

How do I correct this? :anguished:


Hi, I checked the processing of mails a couple of minutes in another thread. Have a look at: How secure is the password when sending an email?

Also you should check page of npm url describes how to define the URI


You could also try once to change the code line 36 and check not for value 465 but for 587 as you defined at your URI.

If you have a look at WikiPedia SMTP there are now two PORT for SMTPS 465 and 587.

@mesosteros : So pretty sure, that this could solve your problem. Please leav a feedback, I would send an PR to meteor if that works.


The error was more embarrassing: I was using my mailgun account username and password instead of the domain’s.
Still, now I don’t get any errors but email is not received, even in the deployed version.


@mesosteros : have you checked to change the source line to port 587 once ?