Using PowerShell to test SMTP

Share this:

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

Solution


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).

image

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

image

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 ITPROCentral.com, MSExchange.org, Techgenix.com and Anderson Patricio.org (Portuguese).

Related Post

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...
PowerShell Script to fix Exchange Server 2013 Secu... I wrote the following PowerShell script to help fixing the issue reported by Microsoft Exchange Team (http://blogs.technet.com/b/exchange/archive/2013...
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...