The SMTP (Simple Mail Transfer Protocol) is simply a message transfer protocol, a protocol that provides reliable and efficient e-mail transport. SMTP is a mail service that is built on the FTP file transfer service, primarily for messaging messages between systems and providing notifications related to letters.
SMTP is working in two cases: one, e-mail from the client to the server, and two, from one server to another server. SMTP is also a request/response protocol in which commands and responses are based on the ASCⅡ text and end with CR and LF characters. The response includes a three-bit numeric code that identifies the return status. SMTP listens for continuous requests on TCP protocol Port 25th.
The link and send process are as follows:
(1) Establish TCP connection.
(2) The client sends the HELO command to identify the sender, and then the client sends the Mail command, and the server side responds with OK, indicating that it is ready to receive.
(3) The client sends the RCPT command to identify the intended recipient of the e-mail message, can have multiple rcpt rows, and the server side indicates whether it is willing to receive messages for the recipients.
(4) Negotiation is over, send mail, send with command data.
(5) with "." The end of the input content and send out, end this send, with quit command exit.