What is the best way to send emails from salesforce so that it looks like the email has come directly from my email address and not [email protected] on behalf of...

We use office 365 for our email service.

I have enabled SMTP relay on salesforce. Capture 1Capture 2

Do i need to add all the salesforce IP addresses as an SPF entry for our domain?

How should i setup the connector in Office 365? (step by step instructions would be helpful)

Which IP addresses should i whitelist from this list (https://help.salesforce.com/apex/HTViewSolution?id=000003652) ?

  • did you resolved the issue and got the things working? Commented May 6, 2021 at 9:39

3 Answers 3


It is possible to use Office 365 as your Email Relay server. Microsoft has enabled a partner connector and whitelisted all salesforce IP addresses.

You have to set the following settings

Email Host: xyz.mail.protection.outlook.com
Port 25
TLS Setting Preferred

You setup a partner connector as described here: https://technet.microsoft.com/en-us/library/dn751021(v=exchg.150).aspx


You cannot get a direct connection from SMTP relay of Salesforce to Exchange Online, it does not work. Microsoft does not allow for an open relay from Salesforce. You will need to relay it to an on premise IIS SMTP relay server then to Exchange Online per Microsoft.


In what your trying, you're basically allowing anyone to send email from any Salesforce tenant, through Office 365 on behalf of your domain. Microsoft does not support email relay scenarios from shared IP space (Salesforce, Amazon, Azure etc.).

Static IP address or address range: Most devices or applications are unable to use a certificate for authentication. To authenticate your device or application, use one or more static IP addresses that are not shared with another organization.

You can, however use this option, although it comes with some limitations.

If you don't have any specific requirements, like the use of lightning, you could consider sending directly through Salesforce. This page tells you what the considerations are. Basically setting up SPF and DKIM for email authentication and turning off Bounce Handling will get you there.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .