title: Sending emails on Heroku using external SMTP
body: <p>I want to send emails from my rails application on Heroku.
  As Heroku doesn't support SMTP, I use external SMTP server.</p>
  
  <p>config/environments/production.rb has the following lines.</p>
  
  <pre><code>ActionMailer::Base.delivery_method = :smtp
  ActionMailer::Base.smtp_settings = {
    :address =&gt; 'mydomain.com',
    :port =&gt; 587,
    :user_name =&gt; "myusername",
    :password =&gt; "password",
    :authentication =&gt; :plain,
    :enable_starttls_auto =&gt; true,
    :openssl_verify_mode =&gt; 'none' 
  }
  </code></pre>
  
  <p>When I send an email from "heroku run console", it works fine. But it doesn't send email from the website. Strangely, "heroku logs --tail" shows "Sent mail to ...". Actually the email is not delivered.</p>
  
  <p>Does anyone have any idea about this issue?</p>
  
  <p>Thanks.</p>
  
  <p>Sam Kong</p>