Telnet Test – A Great Troubleshooting Tool & Technique

Oftentimes it is very helpful to remove your mail server from the equation to see if there is an underlying network / reputation problem blocking mail flow. Here’s how you can manually send a test message using the telnet command built into every operating system. You’ll need to determine the name or address of your recipeints mail server. You can do this by looking up their MX record at In my example the MX record is Your commands are in bold below and the responses I got are in italic. Be careful, on Windows if you typo you cannot backspace and correct yourself. Just hit enter and retype the entire command.

telnet 25
Connected to (
Escape character is ‘^]’.

mail from: <>
250 sender <> ok
rcpt to: <>
250 recipient <> ok
354 go ahead
Subject: Test Message
This is a test message.

250 ok:  Message 156715331 accepted
Connection closed by foreign host.

Here you can see that the sender, recipient and message were accepted by the 250 responses from the recieving mail server. If there are problems you will see them reflected with 4xx or 5xx responses that can be very helpful for figuring out the problem.

A few of our readers had asked for an explanation of the above commands, here ya go!

telnet 25 Use the telnet command to connect to on port 25
Trying… Trying to connect
Connected to ( Connection was successful
Escape character is ‘^]’. The server is telling you how to hang up. In this case you press Control-]
220 ESMTP This is called the banner. The server is telling you some more about itself and letting you know that it is your turn to talk. In this case the 220 means that it’s a good connection, the machine’s name is and it can talk using the ESMTP protocol.

helo We are saying hello to the machine and telling it our domain name. I can use the domain name to reverse lookup our IP and make try to make sure we aren’t spoofing somebody else and that we are reputable.
250 The server is saying okay (250 means good) and again telling us it’s name.
mail from: <> I would like to send you a message from <>.
250 sender <> ok The server seems to be agreeable to this idea (again 250 means good). It can use several methods to decide if it wants to accept a message from you.
rcpt to: <> I would like to send the message to <>.
250 recipient <> ok The server again is okay with this transaction so far.
data I am ready to send you the message data.
354 go ahead Server says okie dokie.
Subject: Test Message The message subject.
This is a test message.
Some text.
The period all by itself is the signal that we are done sending message data.
250 ok: Message 156715331 accepted The server has successfully (250 again) accepted the message and assigned it ID 156715331.
quit We are done now. You can close the connection.
221 The server agrees. . Good bye.
Connection closed by foreign host. The server has closed the connection.

4 thoughts on “Telnet Test – A Great Troubleshooting Tool & Technique

  1. Malcolm Macdonald

    I tried to follow it but could not determine where I should substitute my own data input for ‘peter’s. A link to the interpretation of all those Telnet codes would also be handy.

  2. G Barani Prasad

    This look a great tool. I face the following issues:
    1. The connection to the host is lost frequently (may be connectivity, but i use 4Mbps line)
    2. “rcpt to:” command, I receive unrecognised command
    3. I do not know how to interpret the responses except 250 which is command received by the server.

    Will you please give link to technical know how about this tool?

    Thanks & Regards


Leave a Reply