18 lines
499 B
PowerShell
18 lines
499 B
PowerShell
Remove-Variable * -ErrorAction SilentlyContinue
|
|
cls
|
|
$Error.Clear()
|
|
$secpasswd = ConvertTo-SecureString "<password>" -AsPlainText -Force
|
|
$mycreds = New-Object System.Management.Automation.PSCredential("marvin@fam-kamm.de", $secpasswd)
|
|
|
|
Try {
|
|
|
|
Send-MailMessage -From "me@you.we" -To "marvin@fam-kamm.de" -Subject "test1" -SmtpServer "smtp.strato.de" -Port 25 -UseSsl:$true -Credential $mycreds -encoding ([System.Text.Encoding]::UTF8) -ErrorAction Stop
|
|
|
|
} #end try
|
|
|
|
Catch {
|
|
|
|
$Error
|
|
|
|
} #end catch
|