Thursday, 6 December 2012

SMTP Telnet Email Commands to Connect and Test the SMTP Mail Server

SMTP Telnet Email Commands to Connect and Test the SMTP Mail Server

In this article on SMTP Telnet, we will demonstrate various SMTP Telnet commands which are used to connect to SMPT Mail Server and send email. We will see how can we test SMTP Server using Telnet commands. Following is the brief introduction to the SMTP Telnet commands step by step.

1. Open a connection from your computer to your mail server.

SMTP Telnet Command: telnet mail.domain.ext 25

You should receive a reply like:
Trying ???.???.???.???...
Connected to mail.domain.ext.
Escape character is '^]'.
220 mail.domain.ext ESMTP Sendmail ?version-number?; ?date+time+gmtoffset?

2. Delcare where you are sending the email from:

SMTP Telnet Command: HELO

This should give you:
250 mail.domain.ext HELO [], pleased to meet you

3. Give your email address:

SMTP Telnet Command: MAIL FROM: mail@domain.ext

This should yeild:
250 2.1.0
mail@domain.ext... Sender ok
If it doesn't, please see possible problems.

4. Give the recipients address:

SMTP Telnet Command: RCPT TO: mail@otherdomain.ext

This should yeild:
250 2.1.0
mail@otherdomain.ext... Recipient ok
If it doesn't, please see possible problems.

To start composing the message, issue the command DATA.

If you want a subject for your email, type Subject:-type subject here- then press enter twice (these are needed to conform to RFC 882)

You may now proceed to type the body of your message (e.g. hello
mail@otherdomain.ext from mail@domain.ext)

To tell the mail server that you have completed the message enter a single "." on a line on it's own.

The mail server should reply with: 250 2.0.0 ???????? Message accepted for delivery

You can close the connection by issuing the QUIT command.

The mailserver should reply with something like:221 2.0.0 mail.domain.ext closing connection
Connection closed by foreign host.

SMTP Telnet Email Commands: List of Problems and Solutions

1. 501 Sender domain must exist
The domain that you are sending from must exist

2. 503 Need MAIL before RCPT
A recipient has been specified before a sender.

3. 550 mail@domain.ext... Relaying Denied
The mail server has refused to relay mail for you, this may be for any number of reasons but typical resons include:
Not using this provider for an internet connection and/or
Not using an email address provided by the owner of the server.

SMTP Telnet Email Commands: Something to watch out for:

1. If you type too quickly, sometimes it won't recognise your text.
2. The backspace key sometimes does not work with some telnet clients.

No comments:

Post a Comment