
Here is a one-line script based on the Send-MailMessage cmdlet you can use right now to send an email from PowerShell using SMTP protocol. The simplest script to send an email with PowerShell And today, we’ll talk about Send-MailMessage, a cmdlet to send emails from PowerShell, as well as other ways to handle this. At the same time, it is a scripting language that allows you to tailor cmdlets – lightweight commands to perform specific functions.

Windows PowerShell is mostly known as a command-line shell used to solve some administration tasks in Windows and apps running on this OS.
