How to configure Gmail & Email Relay to avoid deliverability issues with emails sent from Salesforce.

salesforce logo

This article is here to help you out if you are receiving the error messages with the “Undeliverable” subject when sending the Email from Salesforce through your Gmail account (similar to the one on the screenshot below).

First off, we’ll need to introduce some terms or rather a term – Email Relay. In simple words, email relay is needed when you trigger the send from one address but need it to be delivered by another. For the case with Salesforce, an email is being sent from but the sending user has a So the ordinal sender “passes=relays” the email to the intermediate sender that is Gmail, so that Gmail is the one who does the job and the recipient sees your real address.

An official Salesforce documentation version “When this feature is enabled, our email server delivers all outbound emails to your email server, which then delivers them to the final recipients. Since your server is doing the final delivery, there is no question as to the legitimacy of the communications.”

In more technical terms SMTP relay is required to transmit messages between domains, it is a third-party application or service that mediates the process of sending, delivering and fetching email between different email hosts.

In order for Salesforce to be able to send the emails correctly from the users with the Gmail (or GSuite) addresses there is some setup to be done on both sides. Here goes


The emails sent from Salesfroce aren’t delivered and every time a user tries to send one there is an following error message that lands in the mailbox:

This message indicates that the Email Relay setup wasn’t done properly. Below are the steps to follow to remedy the situation.



The setup has 2 parts on the Salesforce side and one on the Gmail side. We’ll start with Salesforce first

Configure Email Relay

  1. Go to Setup. In Quick search box type “Email Relay Activation” and click on the corresponding item in the menu.
  2. If you have not activated the Multiple Relays feature you will have the grey box (pic 1) click Try it now. This is an enhancement of the Relay feature that will allow you to configure several domains. If you have an existing email relay (like on the screenshot), your setting and host information will be preserved after activation so just go ahead.

  1. Click Create New Relay.
  2. Enter the following information:
    • Email Host:
    • Port: 587
    • TLS Settings: Required
    • Restrict Relay To Domains: unchecked


  1. Not set up Set Up an Email Domain Filter. In Quick search box type “Email Domain Filter” and click on the corresponding item in the menu.

IMPORTANT: chances are you were following all the steps above in Lightning. If this is the case you end up with no results when searching for Email Domain filters. Don’t panic, that’s another Salesforce compatibility hickup, just switch CLASSIC and repeat step 5.

  1. Click “Create New Domain Filter”. Enter the following information:
    • Sender Domain: *
      (Restricts the email relay to send emails based on the listed sender domains. This field accepts comma-separated values and supports the wildcard character (*). The default is *)
    • Recipient Domain: *
      (Restricts the email relay to send emails based on the listed recipient domains. This field accepts comma-separated values and supports the wildcard character (*). The default is *.
    • Email Relay: 587 [TIs: required].
      Specifies the relay host for the domain filter.
    • Active: check
      Enables or disables the domain filter.


Configure Deliverability Settings

  1. Go to Setup – Email Administration – Deliverability
  2. Find Bounce Management, uncheck the box
  3. Under Email Security Compliance, uncheck the box next to “Enable compliance with standard email security mechanisms.” Google’s servers will manage compliance.




Not the second half of the connction – gmail configuration

  1. Connect as Admin or GSuite account.
  2. Sign up in the Google App Admin Dashboard OR sign-up to the GSuite’s Admin Gmail – Hover over the User Icon on the top right corner Manage This Domain
  3. Click -> Apps -> GSuite -> Gmail -> Advanced Settings -> SMTP




  1. Click Add IP Range and add the all the IP addresses from the table below. The table is grouped by region, you just need to add the ones that correspond to the regions where your users are. Or you can add them all just to be save

I recommend checking this link from time to time in case the ranges get updated  (Full list of IP’s)

The addresses used for email relay include:

IP Address
Canada (Public Cloud)
Australia (Public Cloud)


  • Step 3. Test Deliverability

Now that you are all set it’s time to run some tests.

Email Administration | Test Deliverability.

  1. Go to Setup – Email Administration – Test Deliverability.
  2. Enter your email address and send a test message.
  3. You should receive the following emails that confirm the deliverability

4. Now send some test Email to yourself and check those are getting through. In case you are still receiving the “Undeliverable” error messages, verify the IP range and re-test.

For the curious souls here is more information on the email relay


As usual, if you have any additional questions, drop me a note in the comments section below.


Leave a Reply