Skip to content

Instantly share code, notes, and snippets.

@andineck
Created April 23, 2015 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andineck/c4f4edfc031a7ca6e38c to your computer and use it in GitHub Desktop.
Save andineck/c4f4edfc031a7ca6e38c to your computer and use it in GitHub Desktop.
powershell send email
# email-subscribers.dat is a file with email adresses separated by newline
# SmtpServer must be provided
$emails = Get-Content email-subscribers.dat
foreach($email in $emails) {
Send-MailMessage -From "me@you.com" -To $email -Subject "howzit" -Body "long time no see" -SmtpServer "smtp.google.com"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment