To Send the mail,
You can run it with PowerShell Script or Direct Console itself.
$SmtpClient = new-object system.net.mail.smtpClient
$smtpclient.Host = <Host> like smtp.gmail.com, smtp.live.com
$smtpclient.Port = <Port No>
$smtpclient.EnableSsl =<Boolean Value> like, $true or $false
$smtpClient.Credentials = [Net.NetworkCredential](Get-Credential GmailUserID)
$smtpClient.Send(<From Mail>,<ToMail>,<Subject>,<Body>)
$smtpClient.Send(<From Mail>,<ToMail>,<Subject>,<Body>)
You can run it with PowerShell Script or Direct Console itself.
No comments:
Post a Comment