If you searched for everything you need to know about SMTP, start with this model:
- SMTP is the protocol for sending email
- commands and response codes define each step in delivery
- ports and TLS mode must match
- reliable sending requires testing plus SPF, DKIM, and DMARC controls
Quick answer: what is SMTP?
SMTP (Simple Mail Transfer Protocol) is the standard protocol used to submit and relay outbound email.
It is not a mailbox-reading protocol. Retrieval is handled by IMAP or POP3.
How SMTP works
- Your app or mail client opens a TCP connection to an SMTP server.
- The server greets with
and advertises capabilities after. - Client negotiates security (
) and authentication () when required. - Client sends envelope sender and recipients using
and. - Client sends message content after
. - Server accepts (
) and queues for onward delivery.
SMTP commands you should know
| Command | Purpose |
|---|---|
| Start session and discover ESMTP capabilities |
| Legacy greeting command |
| Upgrade to TLS-encrypted session |
| Authenticate sender identity |
| Declare envelope sender |
| Add recipient |
| Send message headers and body |
| Reset transaction state |
| Keepalive health check |
| End SMTP session |
For detailed command reference, see SMTP commands and responses.
SMTP response code classes
| Class | Meaning | Typical action |
|---|---|---|
| Success | Continue flow |
| More input needed | Send next command/data |
| Temporary failure | Retry with backoff |
| Permanent failure | Fix configuration, policy, or recipient data |
Common examples:
acceptedstart message contentservice unavailablemailbox unavailable (temporary)auth failedrejected or mailbox unavailable
SMTP ports and TLS pairing
| Port | Typical use | TLS mode |
|---|---|---|
| Authenticated submission | STARTTLS |
| Authenticated submission | Implicit TLS |
| Server-to-server relay | Optional/varies |
| Alternate submission | Provider-specific |
Most application senders should start with + STARTTLS.
Related guides:
Production SMTP checklist
- Validate command flow in Email Sandbox.
- Add delivery assertions using Email integration testing.
- Capture bounces and failures with Email Webhooks.
- Enforce sender authentication with SPF, DKIM, and DMARC checks.
- Monitor deliverability using Email deliverability testing.
- Route retries/fallback using Email automation routing.
Common SMTP failure patterns
Auth failures ()
Usually caused by wrong credentials, unsupported auth mechanism, or provider policy mismatch.
Recipient rejections ()
Often caused by nonexistent mailbox, relay policy, or sender reputation/policy issues.
TLS mismatch
Using STARTTLS on implicit TLS ports (or vice versa) causes negotiation failures.
For specific rejection fixes, see Fixing SMTP 550 errors.
FAQ
Is SMTP the same as IMAP?
No. SMTP sends mail. IMAP reads/syncs mailbox state.
Can SMTP acceptance guarantee inbox placement?
No. Accepted mail can still be filtered, deferred, or placed outside primary inbox.
Do I need SMTP if I use an email API?
Not always directly, but email APIs still operate on SMTP-compatible delivery infrastructure.

