Informatics Support

Use Telnet on Port 25 to test SMTP communication

We will be explaining how to use Telnet to test SMTP communications. To do this we will be using some values that you will need to replace with your own values. To identify the values to be changed we will be using in this article Bold Letters in UPPER CASE.

 Please, install Telnet Client by running the following command in an opened as Administrator Command Prompt:

pkgmgr -iu:"TelnetClient"

1- Open a Command Prompt window, type telnet, and then press Enter.

This command opens the Telnet session. Please keep in mind that once you are typing in Telnet if you need to correct, back space does not work, just hit enter and retype the command. 

2 -Type set localecho, and then press Enter.

This optional command lets you view the characters as you type them, and it might be required for some SMTP servers.

3- Type set logfile <filename>, and then press Enter.

This  command enables logging and specifies the log file for the Telnet session. If you only specify a file name, the log file is located in the current folder. If you specify a path and file name, the path needs to be on the local computer, and you might need to enter the path and file name in the Windows DOS 8.3 format (short name with no spaces). The path needs to exist, but the log file is created automatically.

4- Type OPEN MAIL1.FABRIKAM.COM 25, and then press Enter.

5- Type EHLO CONTOSO.COM, and then press Enter.

6- Type MAIL FROM:<CHRIS@CONTOSO.COM>, and then press Enter.

7- Type RCPT TO:<KATE@STARLIMS.COM> NOTIFY=success,failure, and then press Enter.

The optional NOTIFY command specifies the particular delivery status notification (DSN) messages (also known as bounce messages, nondelivery reports, or NDRs) that the SMTP is required to provide. In this example, you're requesting a DSN message for successful or failed message delivery.

8- Type DATA, and then press Enter.

9- Type Subject: Test from Contoso, and then press Enter.

10 Press Enter again.

A blank line is needed between the Subject: field and the message body.

11- Type This is a test message, and then press Enter.

12- Type a period ( . ), and then press Enter.

13- To disconnect from the SMTP server, type QUIT, and then press Enter.

14- To close the Telnet session, type quit, and then press Enter.

Here's what a successful session using the steps above looks like:

C:\Windows\System32> telnet
Microsoft Telnet> set localecho
Microsoft Telnet> set logfile c:\TelnetTest.txt
Microsoft Telnet> OPEN 25
220 Microsoft ESMTP MAIL Service ready at Fri, 5 Aug 2016 16:24:41 -0700
EHLO Hello []
250-SIZE 37748736
250 2.1.0 Sender OK
250 2.1.5 Recipient OK
354 Start mail input; end with <CRLF>.<CRLF>
Subject: test

This is a test message.
250 2.6.0 <> [InternalId=5111011082268,] Queued mail for delivery
221 2.0.0 Service closing transmission channel


Usually the user SMTP Server is wrong and when you use the OPEN command it will give you an error. 

Have more questions? Submit a request


Article is closed for comments.
Powered by Zendesk