Skip to content

Instantly share code, notes, and snippets.

@andineck

andineck/email.ps1

Created Apr 23, 2015
Embed
What would you like to do?
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