Using Powershell to send email message using CDOSYS
Scripts are used do a pre-check before getting started with debugging application.
VB Scripts being the favourite on Microsoft platform.
Most common being CDOSYS issues.
Below is the Powershell script to send email using System.Net.Mail namespace.
[System.Net.Mail.MailMessage]$message = New-Object System.Net.Mail.MailMessage("from@contoso.com</A minmax_bound="true">", "to@contoso.com</A minmax_bound="true">", "This is Subject", "This is body")
[System.Net.Mail.SmtpClient]$client = New-Object System.Net.Mail.SmtpClient("XXX.XXX.XXX.XXX")
$client.Timeout = 100
$client.Send($message)
Long live Powershell!Published Friday, January 16, 2009 9:18 PM by nayank
Nayan's [MSFT] Blog : Using Powershell to send email message using CDOSYS
No comments:
Post a Comment