Note This article describes how to enable on-premises LOB applications and devices to send mail to Office 365 mailboxes only in a domain for which you are authoritative. This article doesn't discuss how to enable applications to use Office 365 transport servers to relay to other domains that you own. The mail relay scenario is beyond the scope of this article. For more information about how to set up a mail relay in Office 365, see the following Microsoft Knowledge Base article:
2600912 How to set up an SMTP relay in Office 365