How To: Use Telnet to test SMTP communication

I often have a situation where I need to setup some kind of email notification for some third party app and it often doesn`t work. In order to validate email communication telnet is my best bet.

If you are testing from Windows Server 2012 R2 (like in this case) you`ll first have to enable Telnet Client. That can be done by going to Server Manager | Manage (top right part of the screen) choose Add Roles and Features from Manage menu | click Next until Features menu | choose Telnet Client | Install

Open Command Prompt with Administrator privileges

Screenshots are here just for comparison of command outputs, many vital parts of information are blacked out for security purpose, because I`m testing on actual domain.

Into cmd enter following commands (mail.domain.com change with actual domain you want to test) :

telnet mail.domain.com 25

You`ll get something like this:

TelentSMTP_1

 

EHLO domain.com

You should get following response. If ok last line should be 250 OK, or something similar like in screenshot

TelentSMTP_2

MAIL FROM:name@domain.com

Result should be 250 Sender OK

TelentSMTP_3

RCPT TO:name@domain.com

Result should be 250 Recipient OK

TelentSMTP_4

Into next line enter:

DATA

You should get status 354 Start mail input

TelentSMTP_5

Enter following:

Subject: test subject

(I entered testna poruka, you can write anything you want instead of test subject)

Press ENTER two times and in second line type period (.) and confirm with ENTER again.

TelentSMTP_6

This is the result I received after pressing enter after entering period(.)

TelentSMTP_7

Shortly after confirming send I received email

TelentSMTP_9

My test was successful. If you have any problems refer to Technet – https://technet.microsoft.com/en-us/library/aa995718%28v=exchg.65%29.aspx

To exit session type:

QUIT

221 closing transmission channel should be result.
TelentSMTP_8

 

Disclaimer