Would you like to learn how to send an email using Powershell? In this tutorial, we are going to show you how to use Powershell to send email notifications using the command-line on a computer running Windows.

• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 10

Equipment list

The following section presents the list of equipment used to create this tutorial.

As an Amazon Associate, I earn from qualifying purchases.

Related tutorial - PowerShell

On this page, we offer quick access to a list of tutorials related to PowerShell.

Tutorial Powershell - Send email using the command-line

As an Administrator, start a new POWERSHELL command-line prompt.

Windows 10 - powershell elevated

Send an email using Powershell.

Copy to Clipboard

Here is the message sent.

Copy to Clipboard

In our example, 192.168.2.106 is the IP address of the SMTP server.

In our example, 192.168.2.107 is the IP address of the client computer using PowerShell.

The SMTP server must allow your IP address to send messages.

Send the email with an attachment using Powershell.

Copy to Clipboard

Here is the message sent.

Copy to Clipboard

Use the Powershell command-line to send an email using a credential and port 567.

Copy to Clipboard

Enter the SMTP credentials.

Powershell - Email credentials

In our example, we sent a message using credentials and port 567.

Use Powershell to send an email using a stored credential.

Copy to Clipboard

In our example, the SMTP port is 567 and the SSL encryption is enabled.

In our example, we used a stored credential.

Send an email using older Powershell versions.

Copy to Clipboard

Congratulations! You are able to send an email using Powershell.