Simple Mail Transfer Protocol
Simple Mail Transfer Protocol (SMTP) is a protocol used for the transmission of electronic mail (email) over a computer network. SMTP is a text-based protocol that facilitates the sending and receiving of emails between servers and is a fundamental component of email communication on the internet.
Key Concepts
1. Message Transfer:
- SMTP is primarily responsible for the transfer of email messages between a sender’s email client (Mail User Agent - MUA) and a recipient’s email server (Mail Submission Agent - MSA) and between email servers (Mail Transfer Agent - MTA).
2. Client-Server Interaction:
- SMTP operates on a client-server model, where an email client sends messages to an email server for delivery. Servers communicate with each other to relay messages.
3. Port Number:
- SMTP uses port
25for unencrypted communication. Port587is commonly used for secure communication with Transport Layer Security (TLS).
4. Commands and Responses:
- SMTP communication involves a series of commands and responses between the client and server. Common commands include
HELO(client identification),MAIL FROM(specify sender address),RCPT TO(specify recipient address),DATA(begin message data input), andQUIT(terminate the session).
5. Relaying:
- SMTP allows for the relaying of messages between different email servers, facilitating the delivery of emails across different domains.
SMTP Operation
1. Handshake:
- The SMTP session begins with a handshake, where the client identifies itself to the server using the
HELOorEHLO(extended hello) command.
2. Sender and Recipient Specification:
- The client specifies the sender’s address using the
MAIL FROMcommand and the recipient’s address using theRCPT TOcommand.
3. Message Transmission:
- The actual message is transmitted using the
DATAcommand, allowing the client to send the message body and headers.
4. Session Termination:
- The session concludes with the
QUITcommand, indicating the end of the SMTP communication.