i want to send an email from creating batch file and i need to run it through task scheduler.
$EmailFrom = "nagarajpujar.vc@gmail.com"
$EmailTo = "ashokkhot.vc@gmail.com"
$Subject = "The subject of your email"
$Body = "This is just a test mail to verify the working of CMD"
$SMTPServer = "smtp.gmail.com"
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 465)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential("nagarajpujar.vc@gmail.com", "Nagaraj@123");
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)
i tried with this code in command prompt. i am using Windows 7.. Help me..
via Nagaraj P
No comments:
Post a Comment