Thursday, December 23, 2010

How To: Sending email over Power Shell

$EmailFrom = ""
$EmailTo = ""
$Subject = "Your subject goes here"
$Body = "the body info which usually will a parameter with gathered info."
$SMTPServer = ""
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 25)
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential("user", "pwd");
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)

No comments:

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: Its free and easy to use, we provide all sources at codeplex.

Facebook Badge