Another scripting day…I'm now a spammer!
$MyReader = new-objectSystem.IO.StreamReader("C:message.txt");$message = $MyReader.ReadToEnd();$MyReader.Close();#$message = Get-Content -encoding UTF8 -path C:email.txtforeach ($user in Get-Content C:names.txt) {$smtp = new-objectNet.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.