Using Telnet and SMTP verbs to send e-mail

Sometimes I need to troubleshoot (or just test) mailflow. In these occasions my best tool is the command line, the Telnet client (if you're using Windows 2008 don't forget to add it from the Features list) and the SMTP verbs: EHLO, MAIL FROM, RCPT TO, DATA.

  1. The first step is to create a Telnet session to the server (usually the Edge or the Hub Transport server):
    C:\> Telnet 25
  2. The server will respond with:
    220 Microsoft ESMTP MAIL Service ready at Wed, 26 Aug 2009
     09:51:23 +0100
  3. Then we can start issuing the SMTP verbs:
    250 Hello []
    MAIL FROM:<[email protected]>
    250 2.1.0 [email protected]….Sender OK
    RCPT TO:<[email protected]>
    250 2.1.5 [email protected]
    354 Start mail input; end with .
    Just a test message, please ignore.
    250 2.6.0 Queued mail for delivery
    221 2.0.0 Service closing transmission channel

Mind the anti-spam agents, as the message can end up by being rejected!

For more information, please read RFC 2821 and the following KB article: Telnet to Port 25 to Test SMTP Communication.

About The Author

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top