Windows Send Email using Command Line

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.

Read Also:  Laravel 6 right join query Example Tutorial

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)

Windows Send Email using Command Line
Windows Send Email using Command Line

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.

Read Also:  Fatal error: Call to undefined function sqlsrv_connect()
Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

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.