title: Sendgrid / email sending issues in Ruby on Rails (hosted on Heroku)
body: <p>im having a problem getting sendgrid to send emails successfully on a rails 3.1 app that's using authlogic for authentication and is being deployed on heroku. i have the following action mailer configuration on config/environments/[development.rb and production.rb]: </p>
  
  <p><pre><code>config.action_mailer.delivery_method = :smtp
  config.action_mailer.default_url_options = { :host => 'localhost:3000' }
  config.action_mailer.default_charset = "utf-8"
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.perform_deliveries = true
  config.action_mailer.smtp_settings = {
    :address => 'smtp.sendgrid.net',
    :port => 587,
    :domain => ENV['SENDGRID_DOMAIN'],
    :user_name =>  ENV['SENDGRID_USERNAME'],
    :password => ENV['SENDGRID_PASSWORD'],
    :authentication => 'plain',
    :enable_starttls_auto => true
  }</pre></code></p>
  
  <p>for production.rb, the above code is the same except for </p>
  
  <p><pre><code>
      config.action_mailer.default_url_options = { :host => [app name in heroku] }
  </pre></code></p>
  
  <p>when i run it development mode, i get the following error reported:</p>
  
  <p><pre><code>
      Completed 500 Internal Server Error in 21740ms
      Net::SMTPFatalError (550 Cannot receive from specified address notification@[app-domain]: Unauthenticated senders not allowed
  ):
  </pre></code></p>
  
  <p>i now dont really know how to set it up to get it working. does anyone with some prior experience on setting up sendgrid on heroku and rails know what's going on?</p>
  
  <p>thank you so much. you guys are the best!!!</p>