Testing the connection with the SMTP server using TELNET

Testing the connection with the SMTP server using TELNET


by martin on Thu 18 March 2010 10:22 in Other
tags: connection error, outlook problems, telnet, connecting, connection, smtp error

One of the most frequent questions about Microsoft Outlook is the one concerning problems with sending the messages via SMTP server. The problem may occur directly after configuring the mail account or appear unexpectedly. The users often try to find a reason in Outlook. However Outlook is usually not responsible for problems with sending the messages. The most common reasons are: not proper configuration of the account or blocking the ports by other programs, such as antivirus or firewall - in result the connection with the SMTP server is not available.

The example error displayed by Outlook looks like this:

The server responded with an error. Account: 'pop3.outlook-center.com', Server:
'pop.outlook-center.com', Protocol: SMTP, Port: 25, Secure (SSL): No,
Socket Error:
10060, Error Number: 0x800CCC0E

The easiest and the fastest way to check if Outlook is responsible for the problem is to send the message to your own SMTP server using Telnet program.
This program allows you to connect with the email server directly form the command line on the communication protocol TCP/IP level, and to communicate with the server through SMTP (Simple Mail Transport Protocol). The basic SMTP is very simple text protocol so even not experienced user should have no problems with sending an email using SMTP commands.

In the example below we'll test the connection with outlook-center.com server for account: info@codetwo.com and we'll send a test message. The commands typed by the user are marked in bold green. The commands displayed by the server SMTP are marked in unbold green. After typing the command you have to press Enter to execute it. To make a test do the following:

Click menu Start, choose Run and in edit field type:

cmd

The command line console will open. Now you need to run telnet program wiht 2 parameters. First parameter should be the SMTP server name and the second one - TCP port used for the connection. The TCP port is defined by the SMTP service provider, so usually can be found in the instruction about the configuration:

telnet codetwo.com 25

If the connection with the SMTP server fails, you should get the fallowing information:

Connecting To codetwo.com...Could not open connection to the host, on port 465: connect failed

In this case we are sure there are problems with the connection and we should check the computer or the network configuration, not Outlook.

If we are able to connect succesfully, we should see the welcome info, for example:

220-adi.ehost.pl ESMTP Exim 4.52 #1 Tue, 13 Feb 2007 22:36:18 +0100
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.

Now we can start sending the commands to the server. The first one is EHLO command, together with our computer name:

EHLO codetwo

The server will answer displaying information about available extensions of the SMTP, e.g.:

250-adi.ehost.pl Hello codetwo [193.239.56.225]
250-SIZE 52428800
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP

We type MAIL FROM command using the address we want to send the message from. We should use the proper email address but not from tested SMTP server. If we use address from this server the server may require authentication and the test would be much more difficult:

MAIL FROM: martin@gmail.com

The server should accept the address answering e.g.:

250 OK

Now we type command RCPT TO with the address we wish to send a message to. It has to be an address from tested SMTP server:

RCPT TO: info@codetwo.com

The server should accept the recipient's address by answering e.g.:

250 Accepted

Now we should use DATA command to inform the server that we are ready to type the text of the message:

DATA

The server will answer that is ready to get the message, for example:

354 Enter message, ending with "." on a line by itself

We can type the message content, the end of the message is marked with single dot in the new line, here is an example:

Subject: Telnet test
This is a test message
.

The server will confirm receiving the message, e.g.:

250 OK id=1HHFZx-0006L4-Oy

Now we can close the connection using QUIT command:

QUIT

The full process of sending the message using Telnet is displayed on Fig. 1.
The green text is typed by the user, the other text is generated by the server.

 Sending the test message via SMTP server using telnet program

Fig. 1. Sending the test message via SMTP server using the telnet program.

If you are able to send the message using Telnet, but you cannot send the same message using Outlook, it means Outlook causes the problem. If however you can't send this message using Telnet, Outlook is not responsible for the problem so you must check the settings of your computer or the settings of the network connection.

 



© All rights reserved. No part or whole of this article may not be reproduced or published without prior permission.