SMTP is a text-based TCP protocol that works on port 25. SMTP works in a lock-step, one-at-a-time dialog, with the client sending commands and the server sending responses for each command.
In a typical session, the dialog goes as follows:
- The client first establishes a connection to the SMTP server.
- The server initiates with a greeting. This greeting indicates that the server is ready to receive commands.
- The client then issues its own greeting.
- The server responds.
- The client sends a command indicating who the mail is from.
- The server responds to indicate that the sender is accepted.
- The client issues another command, which specifies the mail's recipient.
- The server responds indicating the recipient is accepted.
- The client then issues a DATA command.
- The server responds asking the client to proceed.
- The client transfers the email.
The protocol is...