Today, We want to share with you Windows Send Email using Command Line.In this post we will show you How To Send Email From Windows Command Line, hear for sendmail.exe command line windows we will give you demo and example for implement.In this post, we will learn about windows batch script to send email with attachment with an example.
Windows Send Email using Command Line
There are the Following The simple About Windows Send Email using Command Line Full Information With Example and source code.
As I will cover this Post with live Working example to develop batch script to send email automatically, so the send gmail from command line for this example is following below.
Send Email from Windows PowerShell
$From_Email = “[email protected]” $To_Email = “[email protected]” $Email_Subject = “Welcome To Pakainfo 25/04/1992” $Body = “My First Send Email To Windows Command Line” $SMTPServer = “smtp.gmail.com” //SEt Your SMTP $SMTPClient = New-Object Net.Mail.SmtpClient($SMTPServer, 587) $SMTPClient.EnableSsl = $true $SMTPClient.Credentials = New-Object System.Net.NetworkCredential(“Your Live SMTP Username”, “Your Live SMTP Password”); $SMTPClient.Send($From_Email, $To_Email, $Email_Subject, $Body)
This Source Code will send simple email to the recipient some address via terminal defined remote SMTP server. We can also write this in a simple PowerShell script as well as execute.
I hope you get an idea about Windows Send Email using Command Line.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.