Mail Transfer Protocol and commands under each protocol

Source: Internet
Author: User
Tags imap
It programmer development Essentials-all kinds of resources download list, history of the most IT resources, personal collection summary.
SMTP protocol
All called Simple Mail Transfer Protocol, which defines the rules for communication between the mail client software and the SMTP server, and between two SMTP servers.
POP3 Protocol
All called the Post Office Protocol (postoffice Protocol), which defines the communication rules for the mail client software and the POP3 server.
IMAP Protocol
All known as Internet Message Access protocal, an extension of the POP3 protocol that defines communication rules for mail client software and IMAP servers.


commands for the SMTP protocol

SMTP commands and formats
Description
Ehlo<sp><domain><crlf> The EHLO command is the first SMTP command that the SMTP mail sender must send after it establishes a connection with the SMTP mail receiver, and the parameters <domain> represents the host name of the SMTP mail sender. The EHLO command is used to replace the HELO command in the traditional SMTP protocol.
Auth<sp><para><crlf> If the SMTP mail receiver requires an SMTP mail sender for authentication, it prompts the SMTP mail sender for the authentication method it uses, and the SMTP mail sender should then use this command to respond to the SMTP mail receiver, parameters <para> Represents the authentication method of the response, usually the authentication method previously prompted by the SMTP mail receiver.
Mail<sp>from:<reverse-path><crlf> This command is used to specify the e-mail address of the sender of the message, and the parameter <reverse-path> indicates the email address of the person who sent it.
Rcpt<sp>to:<forword-path><crlf> This command specifies the email address of the recipient of the message, and the parameter <forward-path> indicates the recipient's email address. If the message is to be sent to more than one recipient, you should use multiple Rcpt<sp>to commands to specify each recipient's email address separately.
Data<crlf> This command is used to indicate that the SMTP mail sender is ready to start transmitting the message content, and all data sent after this command will be treated as the message content until "<crlf>" is encountered. <CRLF> "identifier, which means the end of the message content.
Quit<crlf> This command indicates that a network connection to the SMTP mail sender will be closed after the SMTP mail receiver receives this command to end the mail delivery process.

POP3 Order of the Protocol

Commands and their usage formats Description
User<sp>username<crlf> The user command is the first command that is typically sent after the POP3 client program connects to the POP3 mail server, and the parameter username represents the recipient's account name.
Pass<sp>password<crlf> The pass command is the command that the POP3 client program then sends after the user command is successfully passed, which is used to pass the account's password, and the parameter password represents the password for the account.
Apop<sp>name,digest<crlf> The APOP command replaces the user and pass command, which submits an account password to the POP3 mail server in the form of a MD5 numeric digest.
Stat<crlf> The stat command is used to query statistics in a mailbox, such as the number of messages in a mailbox and the size of bytes consumed by messages.
Uidl<sp>msg#<crlf> The UIDL command is used to query a unique identifier for a message, and the parameter msg# represents the sequence number of the message, which is a numbered number starting at 1.
List<sp>[msg#]<crlf> The list command lists the message information in the mailbox, and the parameter msg# is an optional parameter that represents the sequence number of the message. When a parameter is not specified, the POP3 server lists all message information in the mailbox, and when the parameter msg# is specified, the POP3 server returns only the message that corresponds to that ordinal.
Retr<sp>msg#<crlf> The list command is used to get the contents of a message, and the parameter msg# represents the sequence number of the message.
Dele<sp>msg#<crlf> The DELE command is used to set the delete tag on a message, and the parameter msg# represents the sequence number of the message. When the POP3 server executes the DELE command, it simply sets the delete flag for the message and does not actually delete the message, only the POP3 server will actually delete all messages that have the delete tag set after the POP3 client program issues the QUIT command.
Rset<crlf> The RSet command clears the delete flag for all messages.
Top<sp>msg#<sp>n<crlf> The top command is used to get the first n rows of the message header and message body of a message, the parameter msg# represents the sequence number of the message, and the parameter n indicates the first few lines of the message to return. Use this command to improve the processing efficiency of the mailing list in the Web mail system (sent to and from the Web site), because in this case you do not need to get the full contents of each message, but only the header information for each message.
Noop<crlf> The NOOP command detects the connection between the POP3 client and the POP3 server.
Quit<crlf> The QUIT command indicates that you want to end the message receipt process, and after the POP3 server receives this command, all messages that have the delete tag set are deleted and the network connection to the POP3 client program is closed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.