If you searched for SMTP commands and responses, use this page as your production debugging reference.

Quick answer

SMTP is a command/response protocol:

  • client sends commands (, , , )
  • server replies with numeric codes (, , , )
  • response classes show whether to continue, retry, or fix configuration

Minimal SMTP session example

Core SMTP commands

CommandWhat it doesTypical use
Announces client and requests capabilitiesStart modern SMTP session
Legacy greetingFallback where ESMTP unsupported
Upgrades connection to TLSSecure transport before auth
Authenticates client identitySubmission through provider
Sets envelope senderStart transaction
Adds recipientOne call per recipient
Sends message headers/bodyTransfer message content
Clears current transaction stateRecover from input mistakes
Health/keepalive commandConnection checks
Ends sessionClean disconnect

Legacy or restricted commands (, ) are commonly disabled for security reasons.

SMTP response code reference

Success ()

  • : service ready
  • : authentication successful
  • : requested action completed
  • : session closing

Intermediate ()

  • : auth challenge
  • : start message input

Temporary failures ()

  • : service unavailable / connection closing
  • : mailbox unavailable (temporary)
  • : local processing error
  • : insufficient system storage

Temporary failures usually require retry with backoff.

Permanent failures ()

  • : syntax error, command unrecognized
  • : syntax error in parameters
  • : bad sequence of commands
  • : authentication required
  • : auth credentials rejected
  • : mailbox unavailable / policy rejection / relay denied
  • : user not local
  • : mailbox exceeded storage allocation
  • : invalid mailbox syntax
  • : transaction rejected

Permanent failures usually require config/policy/address fixes before retry.

SMTP command-level troubleshooting workflow

  1. Confirm port and TLS mode pairing ( + STARTTLS, implicit TLS).
  2. Validate capability advertisement after .
  3. Validate auth mechanism offered by server ( variants).
  4. Validate envelope sender/recipient syntax.
  5. Inspect response class and exact code to choose retry vs fix.
  6. Validate inbox outcomes with receive-side tests.

Useful follow-on guides:

Testing checklist before release

FAQ

What is the most important SMTP command?

is critical because it starts capability negotiation for TLS and auth.

Does always mean delivery success?

No. It means SMTP acceptance at that hop, not guaranteed inbox placement.

Should I retry responses?

Usually no until root cause is fixed. Retry logic is mainly for temporary failures.

Next steps