By default, an Exchange server will try and send emails to a smart host using port 25. Unfortunately, there is no option to change the port number within the Exchange Management Console. This howto guide will show you how to change this to a different port number. This will be done using the Exchange Management Shell.
Note: Changing this setting will effect all traffic going through a send connector, so if you change it back to using DNS, it will try to connect to all mail servers on the specified port. This should stay as port 25, so only change this option when using a smart host, and the smart host requires you use a different port (eg, port 587).
Changing the port number used to connect to a smart host:
Load up the Exchange Management Shell.
Find out the identity of the send connector that you want to change the port number on.
Run the following command to get a list of the send connectors:
Get-SendConnector
Example output:
In this example, the identify of the send connector we want to change is “External Mail”.
Use the relevant “Identity” name from the above output, and use the “Set-SendConnector” command as follows to set which port to use:
Set-SendConnector -identity "External Mail" -Port:587
This will set the send connector to sent emails to the smart host using port 587.
Example output:
View current port setting:
If you want to find out which port is currently being used, you can use the following command:
Get-SendConnector -identity "External Mail" | Format-List
This will output the “Port” as one of the settings.
Example output after changing it to port 587: