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:
Other People Are Reading
Things you need
- Windows XP or later
- SMTP server
Click on the icon "Start" located on the Windows task bar. Then click "Programs," "Accessories" and "WordPad" to start the WordPad program.
Insert the following text in to the WordPad window:
send-mailmessage -to "ToUser <ToUser@test.com>" -from "FromUser <FromUser@test.com>" -subject "PowerShell Email" -body "This is the body of the email" -SmtpServer "smtp.provider.net"
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.
Open the PowerShell program from the "Start" icon on the Windows task bar. Select "Programs," "Accessories" and "Windows PowerShell."
Copy the text from the WordPad screen and paste at the PowerShell command prompt. Press "Enter" to send the email from PowerShell.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for