Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gmail on heroku with Rails 3

I am trying to send emails from Heroku up and running. At the moment I can send emails from Heroku via the "tutorial" at http://blog.heroku.com/archives/2009/11/9/tech_sending_email_with_gmail/, so that is fine.

My current problem is that when I got it to work at Heroku, I can't get it to work in development. I had that up and running with settings in either environment.rb or development.rb, but after the stuff in the tutorial kicked in and I removed the settings in env/dev.rb it doesn't work.

In the browser I get the error msg: 530-5.5.1 Authentication Required. Learn more at (it cuts after Learn more at)

In the server console I get the error msg: Net::SMTPAuthenticationError (530-5.5.1 Authentication Required. Learn more at
):

I have set heroku config:add [email protected] and heroku config:add GMAIL_SMTP_PASSWORD=yourpassword (with my info ;)), but it doesn't help.

Any ideas what I am doing wrong?

Can I do it the old way in development and skip the heroku script in some way?

Cheers Carl

like image 366
abegbg Avatar asked Oct 21 '11 22:10

abegbg


2 Answers

Just do as the above user has said about the SMTP settings.
In addition to that, Gmail blocks unidentified logins from a application to your account without you verifying it.
So go to your Gmail client and log in there.

If that doesn't work go to unlock captcha

like image 51
mrudult Avatar answered Oct 02 '22 19:10

mrudult


I have personally encountered that error sending with Gmail and needed to solve an unlock CAPTCHA to allow the sending. Gmail can be picky with security sometimes, and the documentation is not very apparent.

The full message should read:

530-5.5.1 Authentication Required. Learn more at https://support.google.com/mail/bin/answer.py?hl=en&answer=14257

so check out that link and follow the directions there.

You might need to sign into the Gmail webapp or (what I had to do), solve the unlock CAPTCHA. Or perhaps it is something in your app or environment, but following the Google directions is worth a shot.

like image 36
Jacob Gillespie Avatar answered Oct 02 '22 20:10

Jacob Gillespie