Use Telnet To Test SMTP Communication On Exchange Servers
Use Telnet To Test SMTP Communication On Exchange Servers
learn.microsoft.com
13–16 minutes
Article
02/22/2023
In this article
You can use Telnet to test Simple Mail Transfer Protocol (SMTP)
communication between messaging servers. SMTP is the
protocol that's used to send email messages from one
messaging server to another. Using Telnet can be helpful if
you're having trouble sending or receiving messages because
you can manually send SMTP commands to a messaging
server. In return, the server will reply with responses that would
be returned in a typical connection. These results can
sometimes help you to figure out why you can't send or receive
messages.
Test mail flow from the Internet into your Exchange organization.
Tip
This topic shows you how to use Telnet Client, which is included
with Windows. Third-party Telnet clients might require syntax
that's different from what's shown in this topic.
You might notice some Receive connectors that use TCP port
2525. These are internal Receive connectors and aren't used to
accept anonymous SMTP connections.
Note
Network policies might prevent you from using the Nslookup tool
to query public DNS servers on the Internet. As an alternative,
you can use one of the freely-available DNS lookup or MX
3. Type the name of the domain for which you want to find the MX
record. For example, to find the MX record for the fabrikam.com
domain, type fabrikam.com., and then press Enter.
Note
You can use any of the host names or IP addresses that are
associated with the MX records as the destination SMTP server.
A lower value for preference (preference = 10 vs. 20) indicates a
preferred SMTP server. Multiple MX records and different values
of preference are used for load balancing and fault tolerance.
4. When you're ready to end the Nslookup session, type exit, and
then press Enter.
Tip
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.
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.
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: <[email protected]>
250 2.1.0 Sender OK
RCPT TO: <[email protected]> NOTIFY=success,failure
250 2.1.5 Recipient OK
DATA
354 Start mail input; end with <CRLF>.<CRLF>
Subject: test
[InternalId=5111011082268,
Hostname=mail1.fabrikam.com] Queued mail for
delivery
QUIT
221 2.0.0 Service closing transmission channel
Note
Reply Meaning
code
OPEN command
EHLO command
Note
RCPT TO command
In this article