Fix Office 365 SMTP Relay SendAsDeniedException Errors
Question details
Resolve a SendAsDeniedException when an on-premises IIS SMTP relay sends mail between users in the same Office 365 domain.

- Product
- Exchange Online and IIS SMTP relay
- Device & OS
- Windows server; version not provided
- Scenario
- An on-premises IIS SMTP server relays messages for users in an Office 365 domain.
- Observed behavior
- Messages reach external recipients, but some messages to recipients in the same Office 365 domain fail with error 554 5.2.0 SendAsDeniedException.
Collect the full non-delivery report, including the sender, recipient, timestamp, and diagnostic details. Identify the relay's public IP address and whether IIS uses an Exchange Online connector or an authenticated SMTP account.
Check the Exchange Online relay connector
Use this check to verify that Exchange Online recognizes the on-premises server and its relay connection.
On the IIS SMTP server, open IIS 6.0 Manager and inspect the SMTP virtual server's Delivery and Outbound Security settings. Record the smart host, port, and authentication method.
In the Exchange admin center, go to Mail flow > Connectors and open the connector from your organization's email server to Microsoft 365. Confirm that its certificate or public IP identification matches the relay.
In the Exchange admin center, go to Mail flow > Accepted domains and confirm that the sender's domain is present and verified. Compare the address used in the failed message with the relay configuration.
Send a new message through IIS to an affected internal recipient, then open Mail flow > Message trace in the Exchange admin center. Search by sender, recipient, and time, and review the failure details.

Verify sender addresses and Send As permissions
Use this solution when the relay authenticates as a mailbox or the diagnostic report identifies an unauthorized sender.
Review accepted-domain routing
Use this solution if recipient lookup or mail flow points to an accepted-domain routing issue.
Work with Office documents in WPS Office
WPS Office is a free, lightweight alternative for working with Office documents. Its familiar interface and support for common Microsoft Office formats make it easier to move existing files into your workflow. It does not repair Exchange Online SMTP relay settings.

Frequently Asked Questions
Why can the relay send externally but fail for internal recipients?
External delivery does not prove that internal recipient resolution, sender authorization, or accepted-domain routing is correct. Check the full non-delivery report and use Exchange admin center > Mail flow > Message trace to investigate the failed message.
Should I change the accepted domain to Internal Relay?
Only if some recipients for that domain are hosted outside Exchange Online and an appropriate onward route is configured. Check the current setting under Exchange admin center > Mail flow > Accepted domains; switching the domain type alone may not resolve a Send As error.
Where do I check Send As permissions?
In the Exchange admin center, go to Recipients > Mailboxes, select the mailbox used in the From address, and review its mailbox delegation settings. If an authenticated account sends as that mailbox, grant Send As only where appropriate.
How do I confirm that Exchange Online recognizes my IIS relay?
In Exchange admin center > Mail flow > Connectors, inspect the connector from your organization's email server to Microsoft 365. Compare its configured public IP address or certificate identification with the connection made by the relay.




