What is SMTP? How Email Actually Gets Sent (Plain English Guide)
SMTP is the protocol that moves email between servers. Understanding how it works helps you troubleshoot deliverability issues, configure mail servers, and understand SPF and DMARC.
What is SMTP?
SMTP (Simple Mail Transfer Protocol) is the standard protocol used to send email between mail servers. Defined in RFC 5321, it's the 'push' protocol of email — it moves messages from sender to recipient by relaying them through a chain of mail servers.
When you click Send in Gmail or Outlook, your email client connects to a mail submission server, which uses SMTP to relay the message to the recipient's mail server, which then stores it for retrieval via IMAP or POP3.
SMTP has been in use since 1982. Its original design had no authentication or encryption — both were added later as extensions.
Core SMTP commands
| Command ↕ | Direction ↕ | Purpose ↕ | Example ↕ |
|---|---|---|---|
| EHLO | Client → Server | Introduce client and request list of server extensions | EHLO mail.example.com |
| MAIL FROM | Client → Server | Specify the envelope sender address (return-path) | MAIL FROM:<sender@example.com> |
| RCPT TO | Client → Server | Specify one recipient address; repeat for multiple | RCPT TO:<recipient@example.net> |
| DATA | Client → Server | Begin email data transmission (headers + body) | DATA (server replies 354, then send content, then .) |
| QUIT | Client → Server | End SMTP session gracefully | QUIT |
| RSET | Client → Server | Reset transaction without closing connection | RSET |
| STARTTLS | Client → Server | Upgrade connection to TLS encryption | STARTTLS |
| AUTH | Client → Server | Authenticate with server credentials (port 587) | AUTH LOGIN or AUTH PLAIN |
SMTP response codes reference
| Code ↕ | Category ↕ | Meaning ↕ | Bounce Type ↕ |
|---|---|---|---|
| 220 | 2xx Success | Server ready — connection established | N/A |
| 250 | 2xx Success | Requested action completed successfully | N/A |
| 354 | 3xx Intermediate | Start message input, end with CRLF.CRLF | N/A |
| 421 | 4xx Temp Failure | Service temporarily unavailable; try again later | Soft bounce |
| 450 | 4xx Temp Failure | Mailbox temporarily unavailable (greylisting) | Soft bounce |
| 451 | 4xx Temp Failure | Local error in processing; retry | Soft bounce |
| 452 | 4xx Temp Failure | Insufficient system storage / mailbox full | Soft bounce |
| 550 | 5xx Perm Failure | Mailbox unavailable or policy rejection (blacklist) | Hard bounce |
| 551 | 5xx Perm Failure | User not local; please try forwarding address | Hard bounce |
| 553 | 5xx Perm Failure | Mailbox name not allowed / syntax error in address | Hard bounce |
| 554 | 5xx Perm Failure | Transaction failed / message rejected | Hard bounce |
How SMTP works step by step
1. You click Send — your email client submits the message to your outgoing mail server (MSA) on port 587 with STARTTLS and SMTP AUTH.
2. Your mail server performs a DNS MX lookup to find the recipient domain's mail servers.
3. Your server connects to the recipient's MX server on port 25 and negotiates a TLS connection via STARTTLS.
4. Your server introduces itself with EHLO and lists supported extensions.
5. Your server issues MAIL FROM: (the envelope sender) and RCPT TO: (the recipient).
6. The receiving server may check blacklists, SPF records, and other reputation signals at this point.
7. Your server sends the email DATA — headers and body.
8. The receiving server accepts or rejects with an SMTP status code (2xx = accepted, 4xx = temporary failure, 5xx = permanent failure).
SMTP status codes
200-level (success): 250 OK — message accepted 400-level (temporary failure): 421 — Service unavailable, 450 — Mailbox unavailable, 452 — Insufficient storage. These generate soft bounces — retry later. 500-level (permanent failure): 550 — User unknown or policy rejection, 552 — Exceeded storage allocation, 554 — Transaction failed. These generate hard bounces.
Common deliverability errors: 550 5.7.1 — Message rejected due to spam or policy 550 5.1.1 — Invalid mailbox 421 4.7.0 — IP address sending too quickly (rate limit) 550 5.7.26 — SPF/DMARC policy violation (Gmail)
SMTP ports
Port 25: Server-to-server SMTP (MTA-to-MTA). Cannot be used for client submission — most ISPs block outbound port 25 from residential connections to prevent spam.
Port 587: Mail submission with STARTTLS and SMTP AUTH. The correct port for email clients and applications to submit outgoing email.
Port 465: Legacy SMTPS (SMTP over implicit TLS). Deprecated but still used by some clients.
Port 2525: Unofficial alternative to 587, often used by ESPs as a fallback.
Check your domain's email health
Run a free scan against 60 blacklists. Validate SPF, DKIM, DMARC, and MX records in seconds.
Related free tools