I'm having trouble sending email using Rails 4 action mailer via gmail. It all should be so simple ... yet it isn't working. Specifically, I get
ArgumentError (SMTP-AUTH requested but missing secret phrase):
I've read the other questions here regarding the situation, but most of them had simple fixes ("user_name" instead of "username", or ENV variable was wrong). I've double checked, and I'm certain my credentials are correct. Here is the relevant section of my development.rb:
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'mydomain.com',
user_name: ENV["GMAIL_USERNAME"],
password: ENV["GMAIL_PXXWRD"],
authentication: 'plain',
enable_starttls_auto: true
}
I initially had the credentials in plaintext, but that I though maybe I should move them to env variables to solve the issue. It didn't change anything. As a note, my gmail is a company gmail, so it doesn't actually end in "@gmail.com". I'm not sure if that changes anything, but I thought I'd mention it. I've also tried with a standard gmail address, it changes nothing.
Also, does "missing secret phrase" refer to a bad password? Or is it not finding a password to begin with? What else could cause the error? Thanks for your time guys.