Saturday, September 10, 2005

Sending email using Telnet

Most probably, you will only do this for testing or troubleshooting.

The example below shows you the basic steps of using Telnet to send email via SMTP and you can check out RFC 821 for more information. If you wish to try it out, make sure there is no firewall or anti-virus blocking telnet from using port 25.

Step 1
At the command prompt, type in telnet Your_Smtp_Server 25 replacing Your_Smtp_Server with your own SMTP server name. This is to establish a telnet session with the SMTP server via port 25.
telnet 25

Step 2
Once you have the session established, you need to identify yourself by using the HELO command. For example, HELO My_Domain_Name.
220 ESMTP ; Sat, 10 Sep 2005 00:45:23 +0800
250 Hello [], pleased to meet you

Step 3
You will now need to provide the reverse path. This will appear as the sender for the recipient who receives the email. For example, MAIL FROM:My_SMTP_Email_Address.
250 2.1.0 Sender ok

Step 4
Now you need to provide the recipient's smtp email address. For example, RCPT TO:Recipient_SMTP_Email_Address.
250 2.1.5 Recipient ok

Step 5
Next you will provide the message that you want to send out by using the DATA command.
354 Enter mail, end with "." on a line by itself
subject:Sending Mail using Telnet I am trying to send mail using Telnet.
250 2.0.0 j89GjNT8013407 Message accepted for delivery

Step 6

Finally to quit from the session, use the QUIT command.
quit 221 2.0.0 closing connection

Have fun and enjoy.

No comments: