2

I have a meteor app that is using the email and passwords packages to handle basic password reset functionality.

On my local machine I set the MAIL_URL env variable to:

smtps://{user}:{password}@smtp.gmail.com:465

and after some fiddling with the associated gmail account (I had to allow less secure applications) it worked.

My live environment is heroku, so I set the env variable there using:

heroku config:set MAIL_URL=smtps://{user}:{password}@smtp.gmail.com:465

and then confirmed that it was set using heroku config. But for some reason when I try to reset the password on my production environment, it throws the following error:

Exception while invoking method 'forgotPassword' Error: Invalid login: 534-5.7.14

I even did a heroku restart to be absolutely sure that the env variable was picked up and I still get the error. What's odd is that this is the same error I was getting before I enabled "Less secure apps".

Can anyone see why this might happen? Suggestions as to how I might fix it?

Abe Miessler
  • 82,532
  • 99
  • 305
  • 486

1 Answers1

2

in the Heroku web on your box in Settings/ Config Vars do you actually see this setting?

I see your issue may be due to not confirming the Captcha... Check this out: Nodemailer with Gmail and NodeJS

Paul Paulincai
  • 644
  • 4
  • 8
  • Disabling CAPTCHA did it. For anyone else trying to solve this - go to this URL to disable: https://accounts.google.com/b/0/displayunlockcaptcha – Abe Miessler Jun 19 '18 at 18:48