Powershell: Send any number of test mails

Here is a small script to send any number of test mails to a recipient. It might be quite useful. I needed it today to test Exchange Reporter 2013 *cough* Winking smiley

$anzahl = read-host "Number of mails"
write-host ""
$count = 1
do
{
write-host "Send mail: $count"
Send-MailMessage -SmtpServer FWEX1 -from "testmail@frankysweb.de" -to "administrator@frankysweb.de" -Subject "Testmail $count" -body "Test Mail $count"
$count++
}
while ($count -le $number)

1 thought on “Powershell: Beliebige Anzahl Testmails verschicken”

Leave a Comment