In order to support TLS/SSL with most SMTP servers, it's necessary to specify a port. PowerShell added the -Port parameter to more recent versions of the Send-MailMessage command.
This PR adds support for the SMTP port.
This is a breaking change, as it will not work on systems that do not have the -Port argument.
It would be possible to do this with backward compatibility by checking to see if Send-MailMessage has the port parameter, using something like:
( (Get-Command Send-MailMessage).ParameterSets | Select -ExpandProperty Parameters).Name -Contains "Port"
However this would result in a messy bunch of If/Thens with three more Send-MailMessage calls to get all the permutations, and I decided not to do it.
In order to support TLS/SSL with most SMTP servers, it's necessary to specify a port. PowerShell added the
-Port
parameter to more recent versions of theSend-MailMessage
command.This PR adds support for the SMTP port.
This is a breaking change, as it will not work on systems that do not have the -Port argument.
It would be possible to do this with backward compatibility by checking to see if Send-MailMessage has the port parameter, using something like:
( (Get-Command Send-MailMessage).ParameterSets | Select -ExpandProperty Parameters).Name -Contains "Port"
However this would result in a messy bunch of If/Thens with three more Send-MailMessage calls to get all the permutations, and I decided not to do it.