Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2314

Probleme beim versenden einer E-Mail mit Powershell.

$
0
0

Ich habe ein Skript geschrieben und wenn ich es ausführe bekomme ich diese Fehlermeldung. Was kann dies als Ursache haben?

Skript:
$MyEmail = "windows.ereignis@gmail.com"
$SMTP = "smtp.gmail.com"
$To = "windows.ereignis@gmail.com"
$Subject = "Myth?"
$Body = "Is this a real message?"
$Creds  = (Get-Credential -Credential "$MyEmail")

Send-MailMessage -To $MyEmail -From $MyEmail -Subject $Subject -Body $Body -SmtpServer $SMTP -Credential $Creds -UseSsl -Port 587 -DeliveryNotificationOption Never

 Meldung:
Send-MailMessage : Die Verbindung mit dem Remoteserver kann nicht hergestellt werden.
In Zeile:8 Zeichen:1
+ Send-MailMessage -To $MyEmail -From $MyEmail -Subject $Subject -Body  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpException
    + FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage


Viewing all articles
Browse latest Browse all 2314

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>