Forum Discussion
silverlu1210
Feb 09, 2022Copper Contributor
Send email by powershell script is working on server 2019,but show error on windows server 2016
$username = "Email address removed" $password = "aaaaaabbbbb" $sstr = ConvertTo-SecureString -string $password -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential -arg...
- Feb 10, 2022Thanks guy, Issue resolved. It means TLS should use 1.2 right?
Feb 09, 2022
My first guess would be TLS settings, could you try using [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 before the send-mailmessage?
- sanman1700Aug 04, 2022Copper Contributor
Harm_Veenstra thanks this resolved my issue
- silverlu1210Feb 10, 2022Copper ContributorThanks guy, Issue resolved. It means TLS should use 1.2 right?
- Feb 10, 2022Yes, you can put in in your scripts running on server 2016 or change the server settings to enable it by default https://www.itnota.com/enabling-tls-1-2-default-security-protocol-windows-servers/. Please mark my answer as solution to mark it as solved