Microsoft Exchange Server 2003  – SMTP Raw Commands

Introduction to Exchange Server 2003 SMTP Raw Commands

This page explains the raw SMTP commands that you can execute to troubleshoot email on an Microsoft Exchange 2003 server.  Instead of sending email from Outlook, we will create a telnet shell and then type these SMTP commands, ehlo, Mail from: rcpt to: and data.

Topics for Microsoft Exchange 2003 SMTP Commands


Launch telnet from a cmd prompt

Let us begin troubleshooting with an easy command.  Suppose we wish to test that the SMTP service is running on an Exchange 2003 server.  What we need is a telnet shell, so let us launch a cmd box and then type: Telnet server 25.  Naturally, follow through by pressing the Enter key for the carriage return.

Telnet server 25

Learning Points

  • Telnet is a command to open up a shell.
  • For ‘server’ substitute the name of your Exchange 2003 computer.  My server is called Alan.
  • 25 is the port number for SMTP  (Telnet itself uses port 23).

This is what you should see in the cmd box:

220 Microsoft ESMTP MAIL Service, ……

Learning Points

  • 220 – This return code (220) indicates success.
  • 2yz – Means the SMTP command completed OK.
  • x2z – Means connected.
  •  – Is the fully qualified name of the server.
  • Microsoft ESMTP MAIL Service – Tells you this mail server understands Extended SMTP.

Monitor Your Network with the Real-time Traffic AnalyzerSolarwinds Real-time Traffic Analyzer

The main reason to monitor your network is to check that your all your servers are available.  If there is a network problem you want an interface to show the scope of the problem at a glance.

Even when all servers and routers are available, sooner or later you will be curious to know who, or what, is hogging your precious network’s bandwidth.  A GUI showing the top 10 users makes interesting reading.

Another reason to monitor network traffic is to learn more about your server’s response times and the use of resources.  To take the pain out of capturing frames and analysing the raw data, Guy recommends that you download a copy of the SolarWindsfree Real-time NetFlow Analyzer.

Type in one word: ehlo 

This is what should what you should see when you type ehlo.  (Remember to follow up ehlo by pressing the Enter key.)

220 Microsoft ESMTP MAIL Service,
250 Hello []
250 OK 

SMTP Learning Points for Raw Commands

  • ESMTP uses ehlo as a greeting.  It’s just a way of establishing an initial connection.
  • SMTP uses helo instead of ehlo, this is the older form of the SMTP language.
  • 250 – Means the action which you requested, completed OK.  (Remember codes beginning with 2yz indicate success.

Sending email

Let us finish as we started, by paying attention to detail.  Here are 3 vital SMTP commands to master when you troubleshoot,
mail from:
rcpt to:
Note the colon after both from: and to:.  Also after you type the data, in this example, ‘Where are you server?’, remember to type a full stop ‘.’ or period as some call this key stroke.  Please note that the last but one line is not empty, can you see a ‘.’ representing a full stop?

220 Microsoft ESMTP MAIL Service
250 Hello []
More verbs….
250 OK

mail from:
250 2.1.0….Sender OK
rcpt to:
250 2.1.5
354 Start mail input; end with <CRLF>.<CRLF>
Where are you server?
250 2.6.0 <> Queued mail for delivery

Learning Points

  • Note the colon: after mail from: and rcpt to:.
  • Once you type data, examine the server’s response:
    354 Start mail input, end with <CRLF>.<CRLF>.  SMTP tells you to end with 2 carriage returns with a full stop in between.
  • I confess.  I have an aversion to ‘Test’, so chose ‘Where are you server?’ as the data.
  • Unlike cmd, with SMTP commands you cannot use doskey. (The arrow keys just do not work.)
  • Don’t be put off by lots of 5yz error messages, just try again.
  • When you have finished your SMTP / Telnet session type quit twice, once to end the SMTP session and then once again to end telnet.
  • If you need to authenticate to the Exchange 2003 server then here is how to use Auth Login

Troubleshooting Ideas

Now that you have mastered the SMTP command basics, here are ideas for how and why you would use these raw SMTP commands.  For instance, raw SMTP commands are useful to troubleshoot relaying.  If you try to send an email to recipient address outside your organization, then the reply will tell you whether or not that email is relayed.  For example, the response maybe: 550 5.7.1  Unable to relay.  Whereas if you can relay, then you would get the response of,  250 2.1.5.

If you’re trying to solve the cause of NDRs, try emailing users at different Exchange 2003 servers, the raw command would be similar to,  rcpt to: diffuser@

Guy Recommends:  A Free Trial of the Network Performance Monitor (NPM)Review of Orion NPM v11.5 v11.5

SolarWinds’ Network Performance Monitor will help you discover what’s happening on your network.  This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.

What I like best is the way NPM suggests solutions to network problems.  Its also has the ability to monitor the health of individual VMware virtual machines.  If you are interested in troubleshooting, and creating network maps, then I recommend that you try NPM now.

Download a free trial of SolarWinds’ Network Performance Monitor

SMTP error codes

As I hinted at the beginning, I found this raw SMTP technique difficult and had my fair share of these error codes.  Most of my troubleshooting problems began with 5yz indicating a fatal error with that SMTP command.

421 – <service not available, closing channel> (domain)
451 – <req. action aborted: local error in processing>
452 – <req. action not taken: insufficient system storage>
500 – <syntax error, command unrecognized>
501 – <syntax error in arguments> ()
502 – <command not implemented>
550 – <req. action not taken: mailbox unavailable>
551 – <user not local; please try <forward-path>>
552 – <req. mail action aborted: exceeded storage allocation>
554 – <transaction failed>

See here for NDR and related codes.

Note: it would be unlikely if you got all these errors in one bunch!

SMTP Raw Commands Summary

Knowledge of how to issue raw SMTP commands is handy to troubleshoot email problems in general, and Exchange 2003 server in particular.  The key to success is to open a telnet shell then practice SMTP commands such as, ehlo, mail from: and rcpt to:.

See Also