Skip to content

Instantly share code, notes, and snippets.

@johncant
Created September 12, 2013 13:19
Show Gist options
  • Save johncant/6537138 to your computer and use it in GitHub Desktop.
Save johncant/6537138 to your computer and use it in GitHub Desktop.
Send emails with MS Exchange
# Use whatever your sysadmin says your settings are supposed to be
# ...
# ...
# The problem we had was that the SMTP server our outsourced sysadmin
# would send emails to Gmail, but they would not be received by the MS
# Exchange that he had set up for us. Our Rails mailer config was
# causing a spurious value in the SMTP "MAIL FROM" statement. This
# fixes it:
class ActionMailer::Base
layout 'email'
smtp_settings = # foo
# This WILL NOT WORK! It causes MAIL FROM <garbage@your_app_servers_hostname>
default :sender => "Boppl"
# This works!
default :sender => "Boppl <support@boppl.me>"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment