Seiten

Dienstag, 6. Oktober 2020

Send Mail mit Powershell


SendMail.ps1 File:

param ([string]$subject, [string]$Body, [string]$Attachments)

Send-MailMessage -To 'andi.lanz@gmail.com' -From 'sutter-admin@bluewin.ch' -Attachments $Attachments  -Subject $subject -Body $Body  -Credential(new-object PSCredential('mymail@bluewin.ch',(Convertto-SecureString 'mypassw' -AsPlaintext -Force))) -SmtpServer 'smtpauths.bluewin.ch' -UseSsl -Port 587




*.cmd file:


powershell -executionpolicy remotesigned -File "SendMail.ps1" -Subject "Subject" -Body "Bodytext" -Attachments "Attachment.txt"


Keine Kommentare: