Showing posts with label Email. Show all posts
Showing posts with label Email. Show all posts

Wednesday, August 28, 2013

Send email using Powershell

Sending an email using Powershell couldn't be easier. You just need to use the Send-MailMessage commandlet.

It is used as follows.

Send-MailMessage
 -From "ReubenBartolo@test.com"
-To "ReubenBartolo@test.com"
-Subject "Hello"
-Body "World"
-SmtpServer "mail.test.com"


To add more than one recepient, just add as follows.

-To "Receiver1@test.com","Receiver2@test.com"