Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
SMTP Command Reference
SMTP Command Reference
Commands are sent by the client in order to instruct the server to do something.
The syntax for describing the commands is kept simple. Anything that is between double quotes should be taken literally, except for that is also case-insensitive. Anything inside square brackets is optional. Anything not in double quotes is a keyword defined below.
SP: The space character.
USER: A username on the target host. Case must be preserved for hosts that have case-sensitive usernames.
DOMAIN: A fully-qualified domain name.
ADDRESS: An email address defined as
PARAMS: Parameters negotiated by an extension.
CRLF: The carriage return and line feed characters, i.e.
Every thing else should be considered whitespace and ignored.
"HELO" SP DOMAIN CRLF
The HELLO command is used to by a client to identify itself with a server. This command should only be used as a fallback for servers that do not support EXTENDED HELLO.
"EHLO" SP DOMAIN CRLF
The EXTENDED HELLO command is used by a client to identify itself with a server. This is preferred over HELLO because it allows the client and server to negotiate and use SMTP extensions.
"MAIL FROM:<" ADDRESS ">" [SP PARAMS] CRLF
The MAIL command is used to initiate a transaction in order to send mail. Only one transaction can be in progress at a time.
"RCPT TO:<" ADDRESS ">" [SP PARAMS] CRLF
This RECIPIENT command is used to identify the addresses the mail should be sent to. This command needs to be issued for each individual recipient.
The RESET command instructs the server to cancel the current MAIL transaction if one is in progress.
"VRFY" SP USER CRLF
The VERIFY command instructs the server to determine if the supplied USER is valid.
"EXPN" SP USER CRLF
The EXPAND command instructs the server to determine if the USER is a mailing list, and if it is, to return the members of the list one by one.
"HELP" [SP COMMAND] CRLF
The HELP command will instruct the server to send helpful information. When supplied with a COMMAND, the server may send specific information about that command.
"NOOP" [SP TEXT] CRLF
The NOOP command instructs the server to do nothing except send a reply. The optional TEXT should be ignored.
The QUIT command instructs the server that the client is disconnecting.