SMTP and POP3 commands

SMTP and POP3 are the components used to send and receive email. These tables include the actual commands used by email clients.

A great way to verify an email server is to manually execute the SMTP and POP3 commands directly from the command line by typing in the following:

telnet

Outgoing email (SMTP) uses port #25
Incoming email (POP3) uses port #110.

Outgoing email (SMTP) uses port #25
Incoming email (POP3) uses port #110.

POP3 Commands (Receive Email)
CommandComment
USER Your user name for this mail server
PASS Your password.
QUITEnd your session.
STATNumber and total size of all messages
LIST Message# and size of message
RETR message#Retrieve selected message
DELE message#Delete selected message
NOOPNo-op. Keeps you connection open.
RSETReset the mailbox. Undelete deleted messages.

Normal program flow:
USER
PASS
LIST
DELE
QUIT

Accessing your pop3 server manually is useful when a corrupted message is causing your incoming email to abort. This results in the same message being sent over and over. The best way to solve this problem is to telnet into your email server, delete all messages already received and the offending message.

The backspace is not a key to press when running SMTP/POP3 manually. Only one person can access the mailbox at any time.

SMTP Commands (Send Email)
CommandComment
ATRNAuthenticated TURN
AUTHAuthentication
BDATBinary data
BURLRemote content
DATAThe actual email message to be sent
This command is terminated with a line that contains only a
EHLOExtended HELO
ETRNExtended turn
EXPNExpand
HELOIdentify yourself to the SMTP server.
HELPShow available commands
MAILSend mail from email account
MAIL FROM: me@mydomain.com
NOOPNo-op. Keeps you connection open.
ONEXOne message transaction only
QUITEnd session
RCPTSend email to recipient
RCPT TO: you@yourdomain.com
RSETReset
SAMLSend and mail
SENDSend
SOMLSend or mail
STARTTLS
SUBMITTERSMTP responsible submitter
TURNTurn
VERBVerbose
VRFYVerify

The following is an actual SMTP session. All sessions must start with HELO and end with QUIT.

HELO my.server.com
MAIL FROM:
RCPT TO:
DATA
From: Danny Dolittle
To: Sarah Smith
Subject: Email sample
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii

This is a test email for you to read.
.
QUIT