title: Wrong "Default From" value in Rails Mailer leads to SMTP error on Heroku with SendGrid
body: <p>I'm setting up Mail with Heroku and SendGrid and run into the following error trying to send out an email with Rails:</p>
  
  <pre><code>Net::SMTPFatalError (550 Cannot receive from specified address &lt;my-email@domain.com&gt;: Unauthenticated senders not allowed
  2013-06-01T10:52:34.767516+00:00 app[web.1]:   app/controllers/api/v1/post_controller.rb:84:in `reply'
  </code></pre>
  
  <p>This domain "my-email@domain.com" comes from the "default from" field in my Mailer:</p>
  
  <pre><code>class NotificationMailer &lt; ActionMailer::Base
    default from: "my-email@domain.com"
  
    def post_notification_email(params)
      # Send mail here
    end
  end
  </code></pre>
  
  <p>My big problem is that I don't know what exactly to fill in here. Is this supposed to be my email address? Does it have to be my domain? Is it my Heroku email? My SendGrid email? No idea whatsoever what to do to make SendGrid happy. Removing this line and hoping something would be filled in that works also led to errors. I'm stuck. What are others using for their "default from"?</p>
  
  <p>One more piece, in case it's important: this is all still in development, so I haven't connected it to a domain. I also haven't really created a SendGrid account, just added the SendGrid add-on to my app on Heroku.</p>
  
  <p>UPDATE: posting my action mailer configuration for Production:</p>
  
  <pre><code>ActionMailer::Base.smtp_settings = {
      :address        =&gt; 'smtp.sendgrid.net',
      :port           =&gt; '25',
      :authentication =&gt; :plain,
      :user_name      =&gt; ENV['SENDGRID_USERNAME'],
      :password       =&gt; ENV['SENDGRID_PASSWORD'],
      :domain         =&gt; 'domain.com',
      :enable_starttls_auto =&gt; true
    }
  </code></pre>