There are 3 major components to email:

- User agents
- used on machines to write/send/receive emails
- e.g. Outlook, mail client
- Mail servers
- Maintains inbox/output - mailbox with incoming messages for user, message queue of outgoing mail messages
- Simple mail transfer protocol SMTP)
- Used between mail servers to send email messages
- Client in this case can be considered the sending mail server, server is receiving mail server
SMTP (RFC 5321)
-
Protocol uses TCP to reliably transfer email message from client (mail server initiating connection) to server via port 25
- A direct transfer is done from the sending server to the receiving server
-
3 phases of transfer:
-
We have command/response interaction (like HTTP)
- Commands consist of ASCII text
- Response consists of status code + phrase
-
e.g. see example of SMTP interaction

Comparing SMTP with HTTP:
- Both are application layer protocols which use TCP
- Both have ASCII command/response interaction + status codes
- HTTP involves client pull (receive object from server), SMTP involves client push (client pushes to server)
- HTTP has each object encapsulated in its own response message, SMTP has multiple objects sent in multipart message
- SMTP uses persistent connections
- SMTP requires message (header + body) to be in 7-bit ASCII