Using PowerShell to test SMTP

Share this:

Using PowerShell to simplify the SMTP test in an Exchange Server or any other SMTP server. 


I’ve been using telnet for a while (since Exchange 5.5 to be honest) however PowerShell has a Send-MailMessage cmdlet which makes the entire process much simpler than using telnet.

We just need to add the SMTP Server which we are going to test (-SMTPServer), the recipient (-to), the sender (-From), subject of the message (-Subject) and the body on the message (-Body).


The test is simple, just check the Inbox on the user that we defined the in the –to switch.


By running this cmdlet, the administrator saves a lot of time on the telnet client, and the cmdlet can be used even on Windows 10 client machines.

Written by Anderson Patricio

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange and several other certifications. Anderson has been contributing to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at,, and Anderson (Portuguese).

Related Post

PowerShell Script to fix Exchange Server 2013 Secu... I wrote the following PowerShell script to help fixing the issue reported by Microsoft Exchange Team (
DPM 2012 R2–ID 30146 unkown error protecting... How to solve the ID 30146 Details: Unknown error (0xc0000135) error when protecting Exchange or SharePoing when using DPM Server 2012 or 2012 R2. Sol...
Adding an endpoint on Office 365 Exchange data mig... There is an easy assistant under Setup / Data migration when using Office 365 Admin Center. In this Tutorial, we are going over the process to configu...