How SMTP Email Delivery Works: From EHLO to Queue and Delivery

Intermediate 10 min read Updated 2026-07-25

SMTP is the store-and-forward protocol mail servers use to transfer messages. A sending server finds the recipient domain's MX hosts, connects, introduces itself with EHLO, may negotiate STARTTLS, submits the envelope and message, and either receives acceptance, a temporary 4xx reply, or a permanent 5xx reply.

Quick answer

A normal SMTP transaction is: connect to an MX host, EHLO, optionally STARTTLS and EHLO again, MAIL FROM, one or more RCPT TO commands, DATA, message headers and body, then a final server reply. A 2xx reply accepts the step, 4xx normally means queue and retry, and 5xx normally means do not retry unchanged.

Overview

SMTP separates the transport envelope from the message headers users see. MAIL FROM supplies the envelope sender used for delivery status and SPF evaluation. RCPT TO identifies each envelope recipient. DATA begins the RFC-formatted message containing headers such as From, To, Subject and the body. A receiver can accept some recipients and reject others in the same session.

The protocol is store-and-forward: an outbound server can queue a message locally, retry another MX host, or retry later after a temporary response. This page is a pillar and transaction map. Detailed TLS policy, MTA-STS, TLS-RPT, HELO/EHLO identity and reverse-DNS remediation belong in their dedicated guides.

Why it happens

A single message may cross multiple systems with different availability, policy and reputation decisions. SMTP therefore uses explicit replies at each stage and queues work that cannot be completed immediately. The exact reply text matters: the first digit defines the broad class, while the enhanced status code and human-readable text usually explain the policy or recipient condition.

How to fix it

Capture the complete SMTP reply, the stage where it occurred, the receiving hostname and the timestamp. For 4xx replies, keep the message queued and retry with sensible backoff unless the provider documents a different action. For 5xx replies, correct the recipient, authentication, policy or content problem before resending. Separately test MX reachability, EHLO identity, reverse DNS and STARTTLS rather than guessing from a shortened bounce subject.

Examples

After DATA, a 250 reply means the receiving server accepted responsibility for the message; it does not promise inbox placement. A 451 reply is temporary and normally keeps the message in the sending queue. A 550 reply is permanent for that attempt and requires reading the enhanced code and provider explanation.

Common mistakes

Do not treat every bounce as a DNS problem, retry permanent failures in a tight loop, confuse the visible From header with MAIL FROM, assume STARTTLS alone proves message authenticity, or interpret SMTP acceptance as an inbox guarantee.

Checklist

  • Resolve the recipient domain's MX hosts and priorities.
  • Record the connecting host, EHLO identity and complete SMTP transcript.
  • Confirm STARTTLS capability and certificate health where transport security is expected.
  • Identify whether the reply happened at MAIL FROM, RCPT TO, DATA or after message content.
  • Queue and back off for a genuine 4xx temporary failure.
  • Correct the cause of a 5xx failure before sending the same message again.

Connection, EHLO and capabilities

The sender connects to a selected MX host and sends EHLO with its server identity. The receiver returns capabilities such as STARTTLS and supported extensions. If STARTTLS succeeds, the client normally sends EHLO again inside the encrypted session because the capability set can change.

Envelope commands and message content

MAIL FROM starts the transaction envelope, RCPT TO adds recipients, and DATA transfers the message. The envelope sender can differ from the visible From address, which is why SPF and DMARC alignment are related but distinct checks.

Queue, retry and final outcome

A sending MTA records accepted work in a queue until it can deliver or reaches its retry limit. A 4xx response normally leaves the item queued. A 5xx response normally creates a non-delivery report. Provider-specific enhanced codes should drive the remediation.

Check your domain's email security

Run the free Email Security Score to see how your domain's SPF, DKIM, DMARC, and DNS setup actually looks.

Run the free Email Security Score

Frequently asked questions

What is the difference between a 4xx and 5xx SMTP response?

A 4xx response is temporary and normally asks the sender to retry later. A 5xx response is permanent for the current message or recipient and normally requires a correction before retrying.

Does a 250 accepted reply mean the email reached the inbox?

No. It means the receiving server accepted responsibility for the message. The provider can still route it to spam, quarantine it, apply later filtering, or generate another delivery event.

Where does STARTTLS fit in SMTP?

The receiver advertises STARTTLS after EHLO. The connection is upgraded to TLS before envelope and message transfer, then the client normally sends EHLO again. STARTTLS protects transport but does not replace SPF, DKIM or DMARC.

Check your domain's email security

Run the free Email Security Score to see how your domain's SPF, DKIM, DMARC, and DNS setup actually looks.

Run the free Email Security Score