Informatics Support

Use Telnet on Port 25 to test SMTP

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.

 

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

This command opens the Telnet session.

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 mail1.fabrikam.com 25
220 mail1.fabrikam.com Microsoft ESMTP MAIL Service ready at Fri, 5 Aug 2016 16:24:41 -0700
EHLO contoso.com
250-mail1.fabrikam.com Hello [172.16.0.5]
250-SIZE 37748736
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-X-ANONYMOUSTLS
250-AUTH NTLM
250-X-EXPS GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 XRDST
MAIL FROM: <chris@contoso.com>
250 2.1.0 Sender OK
RCPT TO: <KATE@STARLIMS.COM> NOTIFY=success,failure
250 2.1.5 Recipient OK
DATA
354 Start mail input; end with <CRLF>.<CRLF>
Subject: test

This is a test message.
.
250 2.6.0 <c89b4fcc-3ad1-4758-a1ab-1e820065d622@mail1.fabrikam.com> [InternalId=5111011082268, Hostname=mail1.fabrikam.com] Queued mail for delivery
QUIT
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. 

Haben Sie Fragen? Anfrage einreichen

0 Kommentare

Zu diesem Beitrag können keine Kommentare hinterlassen werden.
Powered by Zendesk