Home > Exchange > Telnet to Port 25 to Test SMTP Communication

Telnet to Port 25 to Test SMTP Communication


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. You can start a Telnet session by using the Telnet command in the following format:
    NotePress ENTER after you type each line.telnet servername portnumber

    For example, type:

    telnet mail.contoso.com 25

    Note You can replace servername with the IP address or the FQDN of the SMTP server that you want to connect to. Remember to press ENTER after each command.
    If the command works, you receive a response from the SMTP server that is similar to the following:

    220 site.contoso.com Microsoft Exchange Internet Mail Connector <version number of the IMC>

    Note There are different versions of Microsoft SMTP or third party SMTP servers, and you may receive different responses from the receiving server. What is important is that you receive the 220 response with the FQDN of the server and the version of SMTP. Additionally, all versions of Microsoft SMTP include the term “Microsoft” in the 220 response.

     

  2. Start communication by typing the following command:EHLO test.com

    Note You can use the HELO command, but EHLO is a verb that exists in the Extended SMTP verb set that is supported in all current Microsoft implementations of SMTP. It is a good idea to use EHLO, unless you believe that there is a problem with the Extended SMTP Verbs.
    If the command is successful, you receive the following response:

    250 OK
  3. Type the following command to tell the receiving SMTP server who the message is from:MAIL FROM:Admin@test.com

    Note This address can be any SMTP address that you want, but it is a good idea to consider the following issues:

    1. Some SMTP mail systems filter messages based on the MAIL FROM: address and may not permit certain IP addresses to connect or may not permit the IP address to send e-mail to the SMTP mail system if the connecting IP address does not match the domain where the SMTP mail system resides. In this example, that domain is test.com.
    2. If you do not use a valid e-mail address when you send a message, you cannot determine if the message had a delivery problem, because the non-delivery report (NDR) cannot reach an IP address that is not valid. If you use a valid e-mail address, you receive the following response from the SMTP server:
      250 OK - MAIL FROM Admin@test.com
  4. Type the following command to tell the receiving SMTP server whom the message is to.
    Note It is a good idea to always use a valid recipient SMTP address in the domain that you are sending to. For example, if you are sending to john@domain.com, you must be certain that john@domain.com exists in the domain. Otherwise, you will receive an NDR.
    Type the following command with the SMTP address of the person you want to send to:RCPT TO: User@Domain.Com

    You receive the following response:

    250 OK - Recipient User@ Domain.Com
  5. Type the following command to tell the SMTP server that you are ready to send data:DATA

    You receive the following response:

     

    354 Send data. End with CRLF.CRLF

     

  6. You are now ready to start typing the 822/2822 section of the message. The user will see this part of the message in their inbox. Type the following command to add a subject line:Subject: test message

    Press ENTER two times. You do not receive a response from this command.
    Note The two ENTER commands comply with Request for Comments (RFC) 822 and 2822. 822 commands must be followed by a blank line.

  7. Type the following command to add message body text:This is a test message you will not see a response from this command.
  8. Type a period (.) at the next blank line, and then press ENTER. You receive the following response:
    250 OK
  9. Close the connection by typing the following command:QUIT

    You receive the following response:

    221 closing connection
  10. Verify that the recipient received the message that you sent. If any error event messages appear in the application event log, or if there are problems receiving the message, check the configuration or the communication to the host.
Advertisements
Categories: Exchange
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: