Testing SMTP with Telnet and PowerShell (Cheat Sheet)

20140707_233042

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.

PowerShell:

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

Telnet:

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 [127.0.0.1]

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

data
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

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

Connection to host lost.

Comments are closed.