Testing SMTP with Telnet and PowerShell (Cheat Sheet)


This is my cheat sheet for sending E-Mail through a SMTP Server. This is particularly useful when configuring and testing a new SMTP server.


Send-MailMessage -SMTPServer hostname -To youremail@domain.com -From none@none.com -Subject “This is a test email” -Body “This is the body of the test email sent via PS.”


C:\>telnet hostname 25
220 ESXi-DEV-WEB01.local Microsoft ESMTP MAIL Service, Version: 7.5.7601.17514 ready at Thu, 24 Jul 2014 01:26:49 -0500

helo test
250 ESXi-DEV-WEB01.local Hello []

mail from:none@none.com
250 2.1.0 none@none.com….Sender OK

rcpt to:youremail@domain.com
250 2.1.5 youremail@domain.com

354 Start mail input; end with .

subject:This is a test email
This is the body of the test email sent via Telnet.

250 2.6.0 Queued mail for delivery

221 2.0.0 ESXi-DEV-WEB01.local Service closing transmission channel

Connection to host lost.

Comments are closed.