Exchange Online (the hosted Exchange product that is sold as part of Microsoft’s Office 365 suite) is fast becoming a gold-standard in the business-grade email market. As a result, there are cases when a Ruby on Rails application would benefit from sending emails via the Exchange Online SMTP service.
Add the below snippet to your environment configuration file (e.g:
Tip: Best practices suggest that the login credentials should be stored in environment variables. This keeps sensitive login credentials out of project source code.
Use the below snippet as a guide when configuring your mailer:
Warning: The email address the mailer sends
from must match the email address used in the Action Mailer configuration’s
user_name field. If this doesn’t match, the message will be rejected by the Exchange Online SMTP service.
If you find during testing that emails are not being sent, temporarily set Action Mailer’s
raise_delivery_errors option to
true to help with debugging.