Habe es probiert, aber glücklos. Sicher mache ich etwas falsch. Was meinst du?
PS C:\Windows\system32> $User = "user@bluewin.ch"
PS C:\Windows\system32> $PWord = ConvertTo-SecureString -String "password" -AsPlainText -Force
PS C:\Windows\system32> $BluewinCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $PWord
PS C:\Windows\system32> Send-MailMessage -To "recipient@usz.ch" -Subject "test" -from "user@bluewin.ch" -UseSsl -Credential $BluewinCredential -SmtpServer "smtpauths.bluewin.ch" -port "465"
Send-MailMessage : Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
At line:1 char:1
+ Send-MailMessage -To "recipient@usz.ch" -Subject "test" -from " ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpExcept
ion
+ FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage