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

  1. Your app or mail client opens a TCP connection to an SMTP server.
  2. The server greets with and advertises capabilities after .
  3. Client negotiates security () and authentication () when required.
  4. Client sends envelope sender and recipients using and .
  5. Client sends message content after .
  6. Server accepts () and queues for onward delivery.

SMTP commands you should know

CommandPurpose
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

ClassMeaningTypical action
SuccessContinue flow
More input neededSend next command/data
Temporary failureRetry with backoff
Permanent failureFix configuration, policy, or recipient data

Common examples:

  • accepted
  • start message content
  • service unavailable
  • mailbox unavailable (temporary)
  • auth failed
  • rejected or mailbox unavailable

SMTP ports and TLS pairing

PortTypical useTLS mode
Authenticated submissionSTARTTLS
Authenticated submissionImplicit TLS
Server-to-server relayOptional/varies
Alternate submissionProvider-specific

Most application senders should start with + STARTTLS.

Related guides:

Production SMTP checklist

  1. Validate command flow in Email Sandbox.
  2. Add delivery assertions using Email integration testing.
  3. Capture bounces and failures with Email Webhooks.
  4. Enforce sender authentication with SPF, DKIM, and DMARC checks.
  5. Monitor deliverability using Email deliverability testing.
  6. 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.

Next steps