Open In App

SMTP Commands

Last Updated : 13 Sep, 2021
Like Article

Simple Mail Transfer Protocol (SMTP) is an ASCII protocol. It is based on client-server model. It uses TCP port number 25 for this service. Therefore e-mail; is delivered from source to destination by having the source machine established a TCP to port 25 of the destination machine. To send mail, a system must contain client MTA and to receive a mail, a system must have server MTA. SMTP transfers this message from client MTA to the server MTA. To send a mail, SMTP is used two times: one between sender and sender’s mail server and the other between the two mail servers. 

SMTP Commands : 
These commands are sent from the client to the server. Each command consists of a keyword followed by zero or more arguments. It means there are also some keywords that do not contain any argument. The format of the command is as follows : 

 Keywords : argument(s) 

There are 14 different SMTP commands which are given in the following table : 

Command form 
1. HELO HELO<SP><domain><CRLF> It provides the identification of the sender i.e. the host name. Mandatory
2. MAIL MAIL<SP>FROM : <reverse-path><CRLF> It specifies the originator of the mail. Mandatory
3. RCPT RCPT<SP>TO : <forward-path><CRLF> It specifies the recipient of mail. Mandatory
4. DATA DATA<CRLF> It specifies the beginning of the mail. Mandatory
5. QUIT QUIT<CRLF> It closes the TCP connection. Mandatory
6. RSET RSET<CRLF> It aborts the current mail transaction but the TCP connection remains open. Highly recommended
7. VRFY VRFY<SP><string><CRLF> It is use to confirm or verify the user name. Highly recommended
8. NOOP NOOP<CRLF> No operation Highly recommended
9. TURN TURN<CRLF> It reverses the role of sender and receiver. Seldom used
10. EXPN EXPN<SP><string><CRLF> It specifies the mailing list to be expanded. Seldom used
11. HELP HELP<SP><string><CRLF> It send some specific documentation to the system. Seldom used
12. SEND SEND<SP>FROM : <reverse-path><CRLF> It send mail to the terminal. Seldom used
13. SOML SOML<SP>FROM : <reverse-path><CRLF> It send mail to the terminal if possible; otherwise to mailbox. Seldom used
14. SAML SAML<SP>FROM : <reverse-path><CRLF> It send mail to the terminal and mailbox. Seldom used


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads