title: SMTP settings for Office 365 in Rails application
body: <p>I have an Office 365 mail account with Godaddy. I'm trying to setup the SMTP settings for my Rails app:</p>
  
  <pre><code>config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
  :address              =&gt; "smtp.office365.com",
  :port                 =&gt; 587,
  :user_name            =&gt; ENV["OFFICE_USERNAME"],
  :password             =&gt; ENV["OFFICE_PASSWORD"],
  :authentication       =&gt; 'login',
  :domain               =&gt; 'example.com',
  :enable_starttls_auto =&gt; true  }
  </code></pre>
  
  <p>but when I test those settings by submitting a message from my contact page, I get this error message:</p>
  
  <blockquote>
    <p>550 5.7.1 Client does not have permissions to send as this sender</p>
  </blockquote>
  
  <p>How to set up the SMTP settings for an Office 365 account in a Rails application?</p>