How to test SMTP communication using Telnet?
| Published date | Fri, 2006-07-21 14:00 |
| Category | |
| Author | Shaji Firoz |
| Printable Version | Email this Article | |
|
|
|
| Post to del.icio.us | Furl it | Spurl it | |
|
|
|
Introduction
In this article I will provide a short description on how to telnet to port 25 on a computer/server that runs Simple Mail Transfer Protocol (SMTP) services to troubleshoot SMTP communication problems. The below information is useful while attempting to resolve SMTP communication issues with MS Exchange based servers.
When to use the following troubleshooting steps?
It depends the type of problem that you are experiencing.
- If you are having problems sending over SMTP between two of your Microsoft Exchange 2000 Server servers, you can test the SMTP connectivity by using Telnet on the sending server to connect to port 25 on the destination server. By default, SMTP listens on port 25.
- If you are having problems receiving SMTP mail from the Internet, you can follow the steps that are listed in this article to test connectivity to your SMTP server from a host that resides on the Internet and that is not on your network.
In the following steps, you run Telnet from the command line. To open a command line, Click Start, click Run, type cmd in the Open box, and then click OK.
1. Telnet into Exchange server hosting SMTP Relay using TCP port 25.
Command is telnet <servername> 25
c:\>telnet ukmtalkex01 25
220 ukmtalkex01.London.Mtalk.net Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready at Fri, 21 Jul 2006 01:28:22 -0400
2.Start communication by typing the following command:
helo <your domain name><enter>
response should be as follows
250 OK
For example,
c:\>helo
250 London.Mtalk.net Hello [10.x.x.x]
3. Type the following command to tell the receiving SMTP server who the message is from:
mail from: <your Email Address><enter>
response should be as follows
250 OK - mail from <your Email address>
For example,
c:\>mail from: jesper@gmail.com
250 2.1.0 jesper@gmail.com....Sender OK
4.Type the following command to tell the receiving SMTP server whom the message is to. Use a valid recipient SMTP address in the domain that you are sending to.
For example, if you are sending to jay.krok@mtalk.net, you must be certain that jay.krok@mtalk.net exists in your domain. Otherwise, you will receive an NDR.
rcpt to: <recipient address><enter>
response should be as follows
250 OK - Recipient <recipient address>
For example,
c:\>rcpt to: jay.krok@mtalk.net
250 2.1.5 jay.krok@mtalk.net
5.Type the following command to tell the SMTP server that you are ready to send data:
data<enter>
response should be as follows
354 Send data. End with CRLF.CRLF
For example,
c:\>data
354 Start mail input; end with <CRLF>.<CRLF>
testing
. 250 2.6.0 <londonKufVma00000503@mtalk.net>
Queued mail for delivery
6. Close the connection by typing the following command:
c:\>QUIT
You receive the following response:
221 closing connection
Summary
If you suspect there are problems receiving or sending Internet mail please follow the steps described above in order and that will identify where the problem may exist.To request a delivery receipt for the test message, see step 4 in the "Basic Testing" section of this article to make sure that the information provided is a valid e-mail address that can receive the delivery receipt. Then in step 5 in the "Basic Testing" section of this article, type the following command in the Telnet session:
c:\>rcpt to:User@Site.Domain.Com notify=success,failure
Related Links:
Telnet to Port 25 to Test SMTP Communicationhttp://support.microsoft.com/kb/q153119/
How can I test to see if my SMTP service is ready to receive incoming mail?
http://www.petri.co.il/test_smtp_service.htm
Discuss this in

About Shaji Firoz

Shaji Firoz is a Senior Consultant working for IT Outsourcing company in Singapore. Shaji works mostly on Microsoft Technologies - with keen on messaging environment. He leads the development & implementation efforts in Exchange & Active Directory environments. He authors MS Exchange based technical articles in this site and spends time on blogging about Hosted Exchange in msexchange.org blog section. In recognition of his knowledge of Windows & Exchange Servers and his willingness to share the information and help to community, Microsoft recognized him with MVP in Exchange Server.
Shaji is primary contributor to DigWin.com & MessagingBlogs.com. He can be reached on shajifiroz@messagingtalk.org
Recent Articles by the author
Featured Links
-
Free Download Trial: SharePoint Migration, Backup and Recovery Software
DocAve: Enterprise, full-fidelity backup & recovery software for SharePoint provides essential protection & management tools, and allows for a data migration from Exchange Public Folders in to SharePoint 2007 & 2003. -
Microsoft Exchange Hosting
24/7 US based support. 99.9% uptime guarantee. Your Mission Critical E-mail is Our Critical Mission. Sign up for our 30 day trial to see the difference. Questions? Call us toll free at (800) 967-3924. -
QuickEmbeddedTips: Tips for Embedded Systems Professionals
Quick Tips for Embedded System Engineers. Visit the site for the latest tips, tutorials on Arm, Linux and VxWorks.


