Using Office 365 Exchange Online for SharePoint on premise outgoing email

A client of mine is in the process of migrating to Office 365. In this particular migration, their Exchange infrastructure moved first, the result being that all user mailboxes are hosted in Exchange Online and the on-premise Exchange servers are being decommissioned. This has an impact on SharePoint's outgoing mail functionality. This blog post details the approach that we used to resolve the issue.

Install SMTP Server as an intermediary

Since the outbound email in SharePoint uses the basic SMTP functionality, we need to have it communicate with an SMTP service that accepts simple requests. Exchange Online has some advanced requirements for messages: transport-level security (TLS); domain or IP Address whitelisting; authenticated sending. (The actual requirements depend on the mail distribution scenario.) Since SharePoint cannot meet these requirements, an intermediary SMTP server is required. In the new configuration, SharePoint will send mail to the intermediary via basic SMTP (port 25). The SMTP server will then relay the messages to Exchange Online, and combined with a mail connector or outbound security, the message will be accepted by Exchange Online for delivery to the intended mailbox.

TechNet articles

The information above, and the configuration steps necessary, are spelled out on TechNet. You may find them hard to locate, since they do not contain SharePoint-specific information. The intermediary SMTP server that we are implementing is at How to configure Internet Information Server (IIS) for relay with Office 365. This solution uses outbound security on IIS SMTP to send emails from an Exchange Online account.

If you wish for the sending email to be from an account that does not have an Exchange Online mailbox, there is a different alternative that uses a Mail Flow connector in Exchange Online. This information can be found at How to Allow a Multi-function Device or Application to Send E-mail through Office 365 Using SMTP.