If you are migrating your mail server or simply moving it's IP address, the SMG will need to have a couple of settings changed to use the new mail server.
Log in to the SMG administration console at https://<smg ip address>:444/ (default login is admin and password is 'admin')
Click on 'Network Configuration' -> 'Host Access Control' in the top menu
Add the new mail server IP address(es) in the 'Allowed to send Outbound' textbox and click 'Set'
Now click on 'Network Configuration' -> 'Mail Routing' in the top menu.
At the bottom of the 'Local Delivery' section, input the domain in the left box and the new mail sever FQDN or IP address in the right box and click 'Add'. This will overwrite any existing entries for the domain. Make sure to do this for all domains that need inbound mail routed to the new mail server.
All changes will take effect within 1 minute. There is no need to reboot the server.
NOTE: If you have a cluster configuration, these routing changes should be performed on all SMG servers as they maintain different routing tables and access control lists.
Switching to Office 365
If you are switching to Microsoft Office365, then the 'Allowed to Send Outbound' list should have all of Microsoft's 365 IP address ranges. They can be found here: https://technet.microsoft.com/library/dn163583(v=exchg.150).aspx For the Mail Routing, Microsoft will provide you with a FQDN to use, something like 'yourdomain-com.mail.protection.outlook.com'. This is the value that should be entered in the right hand box instead of a specific IP address.