Skip to content

Instantly share code, notes, and snippets.



Created Apr 23, 2015
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 "" -To $email -Subject "howzit" -Body "long time no see" -SmtpServer ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment