Testing an SMTP Service using telnet

Here’s a quick way to manually test your SMTP service.

The best plan is to run this test on the server first (ensure that localhost or 127.0.0.1 is allowed to access the service) and then from a remote client next.

Follow these steps

(the response examples are those returned against a Windows 2008 R2 Server SMTP Service):

  1. Type Telnet <server name or IP> 25 at a command prompt, and then press ENTER.

    The output should look something like:
    220
    CP5-15164 Microsoft ESMTP MAIL Service, Version: 7.5.7600.16601 ready at  Fr
    i, 16 Sep 2011 11:23:30 +0100

  2. Type ehlo, and then press ENTER.

    The output resembles the following: 
    250-CP5-15164 Hello [127.0.0.1]
    250-TURN
    250-SIZE 2097152
    250-ETRN
    250-PIPELINING
    250-DSN
    250-ENHANCEDSTATUSCODES
    250-8bitmime
    250-BINARYMIME
    250-CHUNKING
    250-VRFY
    250 OK

  3. Type mail from:email@domain.com, and then press ENTER.

    The output resembles the following:
    250 2.1.0 email@domain.com….Sender OK

  4. Type rcpt to:youremail@domain.com, and then press ENTER.

    The output resembles the following:
    250 2.1.5 youremail@domain.com

  5. Type Data, and then press ENTER.

    The output resembles the following:
    354 Start mail input; end with <CRLF>.<CRLF>

  6. Type Subject:Test # subject, and then press ENTER two times.
  7. Type Test # body, and then press ENTER.
  8. Press ENTER, type a period (.), and then press ENTER.

    The output resembles the following:
    250 2.6.0 <CP5-151641XvpFVjCRG00000007@CP5-15164> Queued mail for delivery

  9. Type quit, and then press ENTER.

    The output resembles the following:
    221 2.0.0 CP5-15164 Service closing transmission channel

2 thoughts on “Testing an SMTP Service using telnet

  1. Thanks, this finally worked. Now I need to figure out how to send the emails from an ASP script in its own folder on an ASP.NET website.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.