title: SendGrid's 550 Unauthenticated senders not allowed in Rail App
body: <p>I'v been trying to integrate SendGrid's SMTP settings directly for Rails App in order to avoid using add-ons from Heroku account. According to <a href="https://sendgrid.com/docs/Integrate/Frameworks/rubyonrails.html" rel="nofollow">SendGrid's document</a>, I follow instruction but strangely got error messages, please see below.</p>
  
  <p>Heroku logs (error): </p>
  
  <pre><code>Net::SMTPFatalError (550 Unauthenticated senders not allowed
  </code></pre>
  
  <p>config/environment.rb</p>
  
  <pre><code># Load the Rails application.
  require File.expand_path('../application', __FILE__)
  
  # Initialize the Rails application.
  Rails.application.initialize!
  
  ActionMailer::Base.smtp_settings = {
    :user_name =&gt; ENV['SENDGRID_USERNAME'],
    :password =&gt; ENV['SENDGRID_PASSWORD'],
    :domain =&gt; 'heroku.com',
    :address =&gt; 'smtp.sendgrid.net',
    :port =&gt; 587,
    :authentication =&gt; :plain,
    :enable_starttls_auto =&gt; true
  }
  </code></pre>