Sending mail from telnet session

by Bharat Suneja

This procedure is commonly used to troubleshoot SMTP hosts. In combination with a nslookup query for MX records for a domain (listed after this) you can successfully figure out if a given domain can receive internet email successfully.

1) Open a telnet session to a SMTP – let’s say – or an IP address
telnet 25
What you get back:
220 Microsoft ESMTP MAIL Service, Version: 6.0.3790.1289 ready at Wed, 19 Oct 2005 10:27:34 -0700

2) Now you can say where you’re sending mail from using HELO
250 Hello []

3) Provide sender’s address
MAIL FROM:[email protected]
250 2.1.0 [email protected]….Sender OK

4) Provide recipient’s address
rcpt to:[email protected]
250 2.1.5 [email protected]

5) To start message content, issue the DATA command
354 Please start mail input.

6) Enter the Subject
Subject: This is a test

7) Type in the body
This is a test from [email protected]

8) To end the message, enter a dot in a new line followed by Enter

250 Mail queued for delivery.

10) Close the connection
221 Closing connection. Good bye.

How to determine the mail exchanger (MX) for a domain

You can use the following procedure to determine the mail servers designated as “mail exchangers” for a domain. This is done by inserting a MX record for those servers in the DNS. Best practice for MX records is to point them to A records. A records are simple hostname to IP address mappings.
Pointing MX records to CNAME records may result in performance issues.

From a command prompt, type:
nslookup -querytype=MX

This should produce output similar to the following:

Non-authoritative answer: MX preference = 10, mail exchanger = MX preference = 20, mail exchanger = internet address = x.x.x.x internet address = x.x.x.x

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: