title: Rails, Heroku and contact form
body: <p>I am trying to implement a simple contact form inside my app. Read through couple of SO posts but still no full solution.</p>
  
  <p>My contact form is working in the development environment. 
  Here is my setup in the config file:</p>
  
  <pre><code>  config.action_mailer.raise_delivery_errors = true
    config.action_mailer.default_url_options = { :host =&gt; 'my_app_name.herokuapp.com' }
  
    ActionMailer::Base.smtp_settings = {
      :address        =&gt; 'smtp.gmail.com',
      :domain         =&gt; 'mail.google.com',
      :port           =&gt; 587,
      :user_name      =&gt; 'my_email@gmail.com',
      :password       =&gt; 'my_password',
      :authentication =&gt; :plain,
    }
  </code></pre>
  
  <p>What I get after running <code>heroku logs</code> is:</p>
  
  <pre><code>2016-10-14T21:08:48.912404+00:00 app[web.1]: I, [2016-10-14T21:08:48.912360 #3]  INFO -- : [eb99e511-dde1-45bc-b56a-6a919f519800] Completed 500 Internal Server Error in 858ms (ActiveRecord: 3.8ms)
  2016-10-14T21:08:48.912986+00:00 app[web.1]: F, [2016-10-14T21:08:48.912936 #3] FATAL -- : [eb99e511-dde1-45bc-b56a-6a919f519800]   
  2016-10-14T21:08:48.913019+00:00 app[web.1]: F, [2016-10-14T21:08:48.912985 #3] FATAL -- : [eb99e511-dde1-45bc-b56a-6a919f519800] Net::SMTPAuthenticationError (534-5.7.14 &lt;https://accounts.google.com/signin/continue?sarp=1&amp;scc=1&amp;plt=AKgnsbuE
  </code></pre>
  
  <p>I have also read <a href="https://stackoverflow.com/questions/18124878/netsmtpauthenticationerror-when-sending-email-from-rails-app-on-staging-envir">this thread</a>, turned on the things that the answer and the comment advised to, but the error still appears.</p>
  
  <p>Anything I missed?</p>
  
  <p>Are there any gems/ plugins that I should consider using instead of built-in ActionMailer?</p>