Anlage des Repos
This commit is contained in:
17
archive/Modules/Send-MailMessage-withLogging.psm1
Normal file
17
archive/Modules/Send-MailMessage-withLogging.psm1
Normal file
@@ -0,0 +1,17 @@
|
||||
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
|
||||
Reference in New Issue
Block a user