Wednesday, 13 June 2012

Emailing using Telnet

Email clients are not always available and you may need to test a system. Doing this is simple as SMTP is a text based protocol.

Some systems are more complex with password requirements, but these are still simple and a quick read of the RFC will display all the commands.

You Do…

Server responds as follows…

Telnet to hostname on port 25

220 (then identifies itself - possibly with several lines of 220 + text)

HELO your_domain_name or whatever

250 (followed by human readable message)

MAIL FROM:you@hostname.com (ie, your email address)

250 is syntactically correct (or similar)

RCPT TO:them@someplace_else.com (email address you want to send to)

250 is syntactically correct

DATA

Tells you to send data then CRLF period CRLF at end

You type your message then CRLF period CRLF (ie, type a period on a line by itself then hit ENTER)

250

QUIT

Signoff message

There are several resources on the web concerning email, the best one to start with the basics is :

http://www.faqs.org/rfcs/rfc821.html

No comments: