How to Setup Office 365 to Route Mail to your Own Email Server (SMTP).
In this guide you'll find detailed steps on how to route mail from Microsoft 365/Office 365 to your own SMTP Email server, by configuring an Outbound Connector in Office365 Exchange Online.
The guidelines apply to the following scenarios:
1. You own the domain "example.com" and in Microsoft365/Office365 you have configured the domain "example.onmicrosoft.com" to take advantage of the features and services that Office365 provides, but you want to keep some or all of your mailboxes on your own external/on-premises mail server (e.g. "mail.example.com").
2. You want to send/route emails from Office 365 domain accounts (e.g. from "user@example.onmicrosoft.com"), to accounts on your main domain (e.g. to "user@example.com") whose mailboxes are hosted on an external SMTP server.
3. You want to forward the invitations from Teams or other Office365 programs from the Office365 Exchange Online accounts to recipients/mailboxes hosted to an external/on-premises server. (e.g. from "user@example.onmicrosoft.com" to "user@example.com").
4. You can't send emails from Office365 domain accounts to your main domain accounts (e.g. from "user@example.onmicrosoft.com" to "user@example.com"), due to error "550 5.1.10 RESOLVER.ADR.RecipientNotFound; Recipient user@example.com not found by SMTP address lookup".
How to Configure Microsoft 365/Office 365 Email Connectors to Route Mail to your Own SMTP Mail Servers.
Step 1. Add & Verify Mail Server's Domain in Office 365.
If you have done it already, add and verify the domain of your own mail server(external/on-premises) , to Office 365. To do that:
- Sign in to the Microsoft 365 admin center with your admin account.
- Go to Settings > Domains & click Add domain
- Follow the steps to add and verify the domain of the mail server (e.g. "example.com"), in Office 365.
Step 2. Set Mail Server's Domain to 'Internal Relay' at Accepted Domains in Office 365.
Now proceed and set the domain of the external/on-premises mail server as "Internal Relay", so that emails for recipients not known to Office365 are relayed to your own email server.
1. Go to Exchange Admin Center > Mail flow > Accepted domains and click on the external mail server's domain (e.g. "example.com").
2. Now, choose "Internal relay" and click Save.
Step 3. Route Office365 emails to your Own Mail Server by Setting Up a New Connector in Microsoft 365 Exchange Admin Center.
After applying the above steps, proceed to configure a new mail routing scenario from Office 365 to your own SMTP mail server, by adding a new Outbound connector in Microsoft 365/Office 365:
1. Go Exchange Admin Center > Mail Flow > Connectors & click Add a connector.
2. At 'New connector' options: select the following and click Next:
- Connection from: Office 365
- Connection to: Partner organization, if your mail server is external (e.g. SMTP), or Your organization's email server, if you have an on-premises mail server (e.g. Exchange).
3. At 'Connector Name': type a name for your connector (e.g. "Outbound connector for example.com"), and optionally type a description below. When done, click Next.
4. At 'Use of connector' options:
a. Select "Only when email messages are sent to these domains"
b. Type your domain name (e.g. "example.com") and then click the plus "+" symbol to add it.
c. When done click Next.
5. At 'Routing' options:
a. Choose "Route email through these smart hosts".
b. Type the SMTP email server name or IP address of your own email server (e.g. "mail.example.com"), and then click the plus "+" symbol to add it.
c. When done, click Next.
6. At 'Security restrictions': choose "Always use Transport Layer Security (TLS) to secure the connection (recommended) and click Next.
7. At 'Validation email' options:
a. Type an active email address that exists on your own mail server. (e.g. "user@example.com), and click the plus "+" symbol
b. Click Validate to validate the connection.
c. After the successful validation click Next. *
* Note: If the first validation is unsuccessful, ensure that you have set the mail server's domain as "Internal Relay" (as instructed in the previous step), and try again after 2-3 minutes.
8. At the next screen, review your settings and click Create connector.
9. Finally click Done to close the "Add a connector" wizard.
10. You're done. From now on, all emails sent from Microsoft 365 accounts to recipients on your organization that does not exist in Microsoft 365, will be routed to your own external mail server.
That's it! Let me know if this guide has helped you by leaving your comment about your experience. Please like and share this guide to help others.