title: Email for user confirmation not sending in production. Rails, Heroku, Devise, Gmail
body: <p>I've looked all over Google and stackoverflow for an answer, but none of them work.
  I'm trying to set up smtp emailing for user confirmation after signing up. It works fine in development. Even with MailCatcher on, it bypasses it somehow and sends to the right email from my assigned gmail.</p>
  
  <p>Here's what's in development.rb:</p>
  
  <pre><code>config.action_mailer.default_url_options = { :host =&gt; 'localhost:3000'}
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {:address =&gt; "localhost", :port =&gt; 1025}
  </code></pre>
  
  <p>Here's what's in production.rb:</p>
  
  <pre><code> config.action_mailer.default_url_options = {:host =&gt; 'myapp.herokuapp.com', :protocol =&gt; 'http'} #I've also tried it without ":protocol =&gt; 'http'"
   config.action_mailer.raise_delivery_errors = true
   config.action_mailer.delivery_method = :smtp
   config.action_mailer.perform_deliveries = true
   config.action_mailer.smtp_settings = {
       :address =&gt; "smtp.gmail.com",
       :port =&gt; 587,
       :authentication =&gt; :plain,   # I've also tried :login
       :enable_starttls_auto =&gt; true,  # Also tried tls =&gt; true
       :user_name =&gt; 'myemail@gmail.com',
       :password =&gt; 'mypassword'
     } #I've also tried having the attribute :domain =&gt; 'myapp.herokuapp.com',
  </code></pre>
  
  <p>In config/initializers/devise.rb</p>
  
  <pre><code>config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'  #It still sends from myemail@gmail.com even with this line uncommented.
  </code></pre>
  
  <p>I don't know how to paste out my entire 7 pages (in word document) worth of heroku logs in code block, so I've pasted them in a google doc.</p>
  
  <p>google doc of heroku logs (I believe I highlighted the part where it started to go wrong on page 1-2): </p>
  
  <p><a href="https://docs.google.com/document/d/1G-cCX7T1sPL5XtjyjHRaWmzfaBbWkuTR2edsDmDm1Pc/edit?usp=sharing" rel="nofollow">https://docs.google.com/document/d/1G-cCX7T1sPL5XtjyjHRaWmzfaBbWkuTR2edsDmDm1Pc/edit?usp=sharing</a></p>
  
  <p>I'm not sure where it's finding the correct email to send from in development. I'm still a novice at this.</p>
  
  <p>edit: I just found out that users that were registered before adding confirmation are not able to log in as well, so it might be a users problem with heroku. But everything still works fine in development.</p>
  
  <p>Help is greatly appreciated, thanks!</p>