Integrate Office365 with Salesforce

Preparation

To get Salesforce to send emails using Office365, you'll need:

  • Email with Office365.com
  • Create an account for SMTPRelay at https://app.getsmtprelay.com

You can find the Salesforce orgId by logging in to Salesforce. It's under Setup, Company Profile, Company Information. It's the 15-character code under Salesforce.com Organization ID.

Salesforce Organization ID

Getting Started

For Office365 to work with multiple users in Salesforce, you will need to create a user/principal for Salesforce. This will be the user who is sending emails on behalf of the Salesforce users.

In order to allow this we need to create a user in Office365 and configure it to allow sending on behalf of other users.

Create an Office365 Email Sender User

Go to the Office365 admin portal (https://portal.office.com/adminportal/home) and go to Users, Active users. Click Add a user and enter the details of this user. We suggest something like "Salesforce" to indicate that this account will be used for sending emails from Salesforce.

After the account is created, you'll need to add the user to all the mailboxes as a delegate.

Go through each user in the list, scroll down to Mail settings and click Edit Exchange properties. This will take you to a new screen.

In this new screen, go to mailbox delegation and add the Salesforce user to the "Send As" list.

After you're done click save.

Once you have done this for all users, you're ready to set up SMTPRelay and Salesforce.

Configure SMTPRelay

Log in to SMTPRelay, and go to your services list:

Click Add a New Relay and enter the Office365 SMTP credentials. Enter your Salesforce orgId.

The SMTP settings for Office365 are:

  • smtp.office365.com
  • port 587

After you click Save, we will automatically validate the authentication settings. If everything is ok, the control panel will show you how to configure Salesforce.

Configure Salesforce

In Salesforce, go to Setup, Email Administration, Email Relay Activation. Enter the following:

Salesforce Relay Settings
  • Email Host: relay.getsmtprelay.com
  • Port: 587
  • TLS Setting: "Preferred"
  • Uncheck "Restrict Relay To Domains"
  • Check Active

Click save.

You might notice a warning about using a relay in combination with bounce management. Office365 will take care of this. In Salesforce, go to Setup, Email Administration, Deliverability. Uncheck:

  • Uncheck "Activate bounce management"
  • Uncheck "Enable compliance with standard email security mechanisms"

Finally, click save.

You should now be able to send a test message from Salesforce. It should be delivered and show up in your Office365 console.

Ready to get started?

Set up SMTP Relay in minutes.

Start Free Trial