18 lines
519 B
PowerShell
18 lines
519 B
PowerShell
Remove-Variable * -ErrorAction SilentlyContinue
|
|
cls
|
|
$Error.Clear()
|
|
$secpasswd = ConvertTo-SecureString "didalog" -AsPlainText -Force
|
|
$mycreds = New-Object System.Management.Automation.PSCredential("digitaldata@mc2.local", $secpasswd)
|
|
|
|
Try {
|
|
|
|
Send-MailMessage -From "digitaldata@mc-2.de" -To "m.kamm@didalog.de" -Subject "test1" -SmtpServer "mc2-vmx01-com01.mc2.local" -Port 25 -UseSsl:$true -Credential $mycreds -encoding ([System.Text.Encoding]::UTF8) -ErrorAction Stop
|
|
|
|
} #end try
|
|
|
|
Catch {
|
|
|
|
$Error
|
|
|
|
} #end catch
|