title: Rails actionmailer, gmail works, office 365 does not.
body: <p>I've got Actionmailer sending emails using gmail with the following settings:</p>
  
  <pre><code>ActionMailer::Base.smtp_settings = {
     :address =&gt; "smtp.gmail.com",
     :port =&gt; 587,
     :domain =&gt; "gmail.com",
     :user_name =&gt; "user_name@gmail.com",
     :password =&gt; "password",
     :authentication =&gt; "plain",
     :enable_starttls_auto =&gt; true
  }
  </code></pre>
  
  <p>However, I can't get office 365 mail to work, I have the following settings:</p>
  
  <pre><code>ActionMailer::Base.smtp_settings = {
      :address =&gt; "smtp.office365.com",
      :port =&gt; 587,
      :domain =&gt; "my_domain.com",
      :user_name =&gt; "username@my_domain.onmicrosoft.com",
      :password =&gt; "password",
      :authentication =&gt; :login, 
      :enable_starttls_auto =&gt; true
  }
  </code></pre>
  
  <p>If I try and send an email with this client I get:</p>
  
  <pre><code>Net::SMTPFatalError
  550 5.7.1 Client does not have permissions to send as this sender
  </code></pre>