SYSK – Test your SMTP mail server with telnet

packet trace of SMTP connection
[Creative Commons License][] photo credit:
When troubleshooting email, it may be
necessary to see what the email server is spitting out, just to make
sure everything is working. The easiest way to do that is to use the
telnet command. Telnet allows you to connect to various services on
remote or local machines through the command line. Today we are going to
be using it to send some email. You’ll first need to bring up the
command-line on your respective operating system. First see if telnet is
installed. Type:
And you should see something like this:
Welcome to Microsoft Telnet Client

Escape Character is 'CTRL+]'

Microsoft Telnet>?
Or this:
Since that works, type quit to exit telnet. Next, we need to open a
connection to our mail server. We will need to know the name or ip
address of the mail server:
telnet 25
(The 25 is the port number that SMTP runs on.) You should then get a
response back from your mail server:

Trying Connected to Escape character is '^]'. 220 ESMTP Postfix
The server is now waiting for a command. We need to say Hello. (* For
the remaining examples I’m going to use the domain You’ll
need to replace that with your local domain name. *)

Which returns:
The mail server now needs to know who is sending the email:
mail from: [email protected]
250 Ok
Who are you sending the mail to?
rcpt to: [email protected]
250 Ok
Now it is time to tell it the message:
354 End data with .
Enter your message:
Subject: test message This is a test message .
To end the message, you need to put a period at the beginning of the
line and hit the return key. Now your message is on its way!
Now type quit to exit

[Creative Commons License]:
“Attribution-NonCommercial-ShareAlike License”

%d bloggers like this: