2

I have a rails app deployed in a free heroku plan and I'm using my Google account to send emails and I can only do this if the captcha is unlocked, so I go to my account settings and allow access. But after a while, I have to do it again, otherwise I get the message:

Net::SMTPAuthenticationError

It took me years to figure out that this was the problem, but now I don't know how to solve it

Éowyn
  • 187
  • 3
  • 17
  • Hello, are you using the gmail api? (https://developers.google.com/gmail/api/quickstart/ruby) if so this question may have the answer you need. https://stackoverflow.com/questions/26852128/smtpauthenticationerror-when-sending-mail-using-gmail-and-python – Jon Jun 25 '18 at 17:12

2 Answers2

3

First try to close all open gmail accounts except the one you plan to use as the mailer and then visit this link https://accounts.google.com/b/0/DisplayUnlockCaptcha then click continue... And also enable less secure app in this https://myaccount.google.com/lesssecureapps. And then push your changes in heroku will remove the SMTPAuthenticationError

Kowsalya R
  • 280
  • 6
  • 10
0

For this you can create an app password, so when you try to login/send email with this, google wouldn't ask to 2 step verifications or things like that. here you have the help page for that.

xploshioOn
  • 4,035
  • 2
  • 28
  • 37