Clever website slogan
Home > Tech

How to Send Email With Telnet
Telnet can be used as another way to send email.

Telnet mail.mydomain.com 25
220 mail.mydomain.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.211 ready at Fri, 4 Mar 2005 17:27:35 -0800
HELO mycomputer.mydomain.com
250 mail.mydomain.com Hello []
MAIL FROM: me@mydomain.com
250 2.1.0 me@mydomain.com....Sender OK
RCPT TO: you@yourdomain.com
250 2.1.5 you@yourdomain.com
354 Start mail input; end with <CRLF>.<CRLF>
Subject: test

Message Body
.    <-- Note period
250 2.6.0 <MAILc1WGfLOG9ep40000031a@mail.mydomain.com> Queued mail for delivery
221 2.0.0 mail.mydomain.com Service closing transmission channel

Connection to host lost.
HELO mycomputer.mydomain.comThe FQDN of the computer you're using.
MAIL FROM: me@mydomain.com The address you want the mail to look like it's from.
RCPT TO: you@yourdomain.com Whom you are sending an email to.
DATA Type this to start your message.
Subject: testInclude a subject line if you so desire.
Message Body Blah, blah, blah.
. Full stop indicating end of email message.
QUIT Goodbye

Common Commands:
HELO  Identifies sender to receiver based on hostnames
EHLO HELO for ESMTP enabled servers. EMSTP server will respond with extensions it supports.
MAIL Initiates e-mail transfer with indication of originator
RCPT idnetifies one of the recipients. Multiples recipients require multiple commands.
DATA Indicates messgae data to be sent in 1288-ASCII-Character
RSET Reset. Recieved email is discarded.
VRFY Asks receiver-SMTP tp verify email address identifies a user.
EXPN Ask receiver-SMTP to confirm identity of a mailing list and return membership of that list.
HELP Requests help on a command
NOOP Requests receiver-SMTP to send an OK
TURN Reverses roles of sender and receiver
QUIT terminate connection.

How to Check Email With Telnet
Telnet can be used as another way to check email.

Telnet mail.mydomain.com 110
+OK Hello there.
USER me@mydomain.com
+OK Password required.
+OK User successfully logged on.
+OK Microsoft Exchange Server 2003 POP3 server version 6.5.6944.0 signing off.

Connection to host lost.

Common Commands:

USER useridWho you are.
PASS passwordWhat your password is.
STATAny new mail?
LISTLists all your email on the server with a number and size.
RETR msg#View message specified by number.
TOP msg# #linesShow the first few lines, specified by #lines, of message.
DELE msg#Delete message by number.

There are other POP commands. See RFC1939 which defines the POP commands and error codes.