Created
April 23, 2015 07:54
-
-
Save andineck/c4f4edfc031a7ca6e38c to your computer and use it in GitHub Desktop.
powershell send email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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