Using SMTP relay via Office365 in Rails apps

First you’ll need to add your production box IP address to Exchange Connector

Example URL: https://outlook.office365.com/ecp/?rfr=Admin_o365&exsvurl=1&Realm=yourdomain.com

Then add the following to application production.rb

and boom! your Rails app will start sending emails through Office 365.