Site icon Franky's Web

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*

$anzahl = read-host "Anzahl Mails"

write-host ""
$count = 1
do
 {
 write-host "Sende 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 $anzahl)
Exit mobile version