Powershell Spamming Machine

Another scripting day…I'm now a spammer! 
$MyReader = new-object 
   System.IO.StreamReader("C:message.txt");
$message = $MyReader.ReadToEnd();
$MyReader.Close();
#$message = Get-Content -encoding UTF8 -path C:email.txt
   foreach ($user in Get-Content C:names.txt) {
      $smtp = new-object 
         Net.Mail.SmtpClient("mail.myserver.com") 
      $smtp.Send("Me <me@email.com>",
         "$user", "Subject", $message)
      }
The script reads in a text file that contains the e-mail message, then it emails everybody listed (one per line) in another file. Pretty simple, but it took me a while to figure it out (about 45 minutes). Boom. Instant spamming machine.

Leave a Reply

Your email address will not be published.