SQL Server Send email using Powershell
Posted by: SQL Server DBA,
on 31 Jan 2012 |
View original | Bookmarked: 0 time(s)
This article explains how to send an email through Powershell.
Very useful if you have a requirement to automate your scripts and send notifications .
The example is calling the SmtpClient Class , which is part of the .Net Framework.
You can call a Function which makes your scripting more modular.
#variables
$emailFrom = "JackVamvas@sqlserver-dba.com"
$emailTo = "dba@sqlserver-dba.com"
$subject = "SQLServer-DBA.com: Powershell Function calling an SMTP server"
$body...