How to Send an Email With Powershell

Written by keith perry

Share

Tweet

Share

Pin

Email

E-mail is a primary method to notify users from a PowerShell program. (Medioimages/Photodisc/Photodisc/Getty Images)

PowerShell is a powerful shell and script language for later versions of the Windows operating system. PowerShell can be used for different functions, including monitoring of systems or applications. Sending an e-mail is standard procedure of notifying users when an issue has occurred. The PowerShell language is equipped with a Send-MailMessage cmdlet capable of sending e-mail. E-mails produced from this cmdlet can include attachments, use secure ports and contain a subject line.

Skill level:

Moderate

Other People Are Reading

Things you need

Windows XP or later

SMTP server

Show MoreHide

Instructions

1

Click on the icon "Start" located on the Windows task bar. Then click "Programs," "Accessories" and "WordPad" to start the WordPad program.

Edit the text in the WordPad window, changing the data "ToUser" and "FromUser" to the name you wish to send the email to and from. Change the body and subject information to meet your needs. Edit the "smpt.provider.net" to the smtp server you access for sending mail.

4

Open the PowerShell program from the "Start" icon on the Windows task bar. Select "Programs," "Accessories" and "Windows PowerShell."

5

Copy the text from the WordPad screen and paste at the PowerShell command prompt. Press "Enter" to send the email from PowerShell.