Wednesday, April 6, 2011

Telnet SMTP Commands

In order to test functionality of SMTP Relay server, sometimes you need to send email using Telnet. This commandline utility works from your windows OS command prompt.
1-
Go to command prompt and invoke Telnet utility followed by smtp relay server's IP address and port number.

Let's suppose IP address for SMTP server is 10.1.1.1 and it is using the default port (25) to relay emails.
so the command would be

telnet 10.1.1.1 25
(press ENTER)

You will get an SMTP banner something like this

220 SMTP.pk-itfabric.com Microsoft ESMTP MAIL Service, Version: 7.5.7600.16385 ready at Wed, 6 Apr 2011 00:23:21 -0700

2-

To start communication type

helo
(press ENTER)

A confirmation message will appear which will show connecting system (client's) IP address

250 SMTP.pk-itfabric.com Hello [10.255.189.13]

3-

Provide sender's email address first using Mail From: command

Mail From:omer@pk-itfabric.com
(press ENTER)

confirmation of sender will be received like this

250 2.1.0 omer@pk-itfabric.com....Sender OK

4-

Provide destination email address using Rcpt To: command

Rcpt To:info@pk-itfabric.com
(press ENTER)

5-

Now write the message text, in order to finish the email text, type " . " in a separate line and press ENTER

the whole scenarion will be like this

Data
(Press ENTER)

you will see following confirmation message

354 Please start mail input.

If you need to mention the email subject type Subject command

Subject:This is a test Message

(Once done with subject press ENTER twice)

now start writing the message body

This is a test message please reply to acknowledge
(press ENTER)

.

(press ENTER)

When you get the following message, it means email has been sent from your system to the relay server

250 Mail queued for delivery.

6-

You can now safely disconnect the session by using Quit command and

Quit

(press ENTER)

you will get a disconnection message
221 Closing Connection. Good bye.

Connection to host lost.


7-

Now check the mail box, if the email is not there it may be in your junk folder since there could be some spam filters imposed by your email service provider.