
The standard communication protocol used to send an electronic mail (email) across IP networks. While protocols like IMAP or POP3 are responsible for receiving and storing mail, SMTP is the delivery vehicle that moves messages from the sender’s client to the recipient’s mail server.
SMTP Specifications
- Function: Outgoing mail transfer.
- Default Ports: * 25: The original, non-encrypted port (mostly used for server-to-server relay).
- Model: Client-Server.
How the SMTP Process Works
SMTP works through a series of commands and responses between two servers:
- Handshake: The sender’s client (e.g., Outlook or Gmail) connects to the SMTP server and says
HELOorEHLO. - Sender/Recipient Info: The client provides the sender’s address (
MAIL FROM:) and the recipient’s address (RCPT TO:). - Data Transfer: The client sends the
DATAcommand, followed by the actual body of the email, headers, and attachments. - Handoff: If the recipient is on a different network, the sender’s SMTP server looks up the MX (Mail Exchanger) record in the DNS to find the recipient’s server and forwards the mail.
- Termination: Once the transfer is confirmed with a
250 OKcode, the connection is closed usingQUIT.
SMTP vs. IMAP/POP3
| Protocol | Direction | Primary Purpose |
| SMTP | Push (Outgoing) | Sends email from a client to a server or between servers. |
| IMAP | Pull (Incoming) | Syncs mail between the server and multiple devices. |
| POP3 | Pull (Incoming) | Downloads mail from the server to a single device (often deleting it from the server). |
Common SMTP Response Codes
If you have ever received a Bounce Back email, it likely contains one of these SMTP status codes:
- 250: Requested mail action okay, completed (Success).
- 421: Service not available, closing transmission channel (Temporary failure).
- 450: Requested mail action not taken: mailbox unavailable (e.g., busy).
- 550: Requested action not taken: mailbox unavailable (e.g., address doesn’t exist).
The Security Problem: Spoofing
Originally, SMTP did not require authentication, which allowed anyone to send mail from any address—leading to the explosion of Spam. To combat this, three modern “safety layers” are now used alongside SMTP: