We’ve been adding the ability for our applications to send email to email addresses outside the organisation, and had issues where the message would be sent to addresses inside the organisation without issue, but was never received outside the organisation.
It turns out that this behaviour is by design – Exchange Server won’t send relay email outside your organisation to prevent spamming. We needed to create a Receive Connector.
If an application or service needs to send email externally, you may need to add a Receive Connector.
- Connect to the Exchange Server.
- Select Exchange Management Console -> Server Configuration -> Hub Transport
- Click on Create new Receive Connector.
- Enter a descriptive name for the connector. Leave the intended user as Custom.
- Leave the local network settings at the default values.
- Enter the FQDN (Fully Qualified Domain Name) of the Exchange server where specified (eg mail.yourdomain.com).
- Remove the existing Remote Network settings and click Add.
- Enter the IP address of the computer attempting to send email.
- Click the New button to finish creating the connector.
- Open the properties of the new connector.
- Click on the Authentication tab and deselect all security mechanisms.
- Click on Permission Groups and select Anonymous Users.
- Click OK.
- Open the Exchange Management Shell.
- Enter the command:
Get-ReceiveConnector "[name]" | Add-AdPermission -User "NT AUTHORITY\ANONYMOUS LOGON" -ExtendedRights "ms-Exch-SMTP-Accept-Any-Recipient"