Overview
Email delivery is far more complex than it appears on the surface. Between the moment your application triggers a send and the moment a message appears in a recipient’s inbox, multiple servers, protocols, and checks are involved. Understanding this pipeline is essential for diagnosing delivery issues, improving inbox placement, and building reliable email-powered features. This guide walks through every stage of the journey — from API request to inbox.The Email Delivery Pipeline
Submission
Your application sends an API request to Lettr containing the recipient address, subject, content, and any additional parameters such as headers, tags, or metadata. Lettr validates the request, checks your account and domain configuration, and accepts the message into its sending queue.
Message Assembly
Lettr constructs the full email message. This includes building the RFC 5322-compliant headers (From, To, Subject, Date, Message-ID), encoding the body using MIME (Multipurpose Internet Mail Extensions) to support HTML, plain text, and attachments, and cryptographically signing the message with DKIM using your domain’s private key.
DNS Lookup
Lettr queries DNS for the recipient domain’s MX (Mail Exchanger) records. These records specify which mail servers are responsible for accepting email on behalf of that domain and their priority order. If no MX records exist, delivery cannot proceed.
SMTP Connection
Lettr opens an SMTP (Simple Mail Transfer Protocol) connection to the highest-priority receiving mail server. The two servers perform a handshake, negotiate TLS encryption when available, and Lettr transmits the message envelope and content.
Authentication Check
The receiving mail server verifies the message’s authenticity by checking three authentication mechanisms:
- SPF — Does the sending IP have permission to send on behalf of the From domain?
- DKIM — Does the cryptographic signature match, proving the message was not altered in transit?
- DMARC — Do SPF and DKIM results align with the domain owner’s published policy?
Content Filtering
The receiving server scans the message content for spam signals, malware, phishing indicators, and policy violations. This includes checking the sender’s IP reputation, analyzing links and attachments, evaluating engagement history, and applying the mailbox provider’s proprietary filtering algorithms.
Delivery Decision
Based on the results of authentication and content filtering, the receiving server makes a final placement decision:
- Inbox — Message passed all checks.
- Spam folder — Message is suspicious but not outright rejected.
- Quarantine — Message is held for administrative review (common in enterprise environments).
- Reject — Message is refused entirely, generating a bounce.
Feedback
After the delivery decision, feedback flows back to Lettr. This includes SMTP response codes during the connection, bounce notifications for rejected messages, and asynchronous signals like opens, clicks, and spam complaints. Lettr processes these events and makes them available through webhooks and your dashboard.
Key Protocols
| Protocol | Purpose |
|---|---|
| SMTP | The standard protocol for transmitting email between servers. Operates on ports 25, 465, or 587. |
| DNS / MX | Maps a recipient domain to the mail servers responsible for receiving its email. |
| SPF | A DNS record that lists which IP addresses are authorized to send email for a domain. |
| DKIM | A cryptographic signature embedded in email headers that proves the message has not been tampered with. |
| DMARC | A policy layer that ties SPF and DKIM together and tells receiving servers what to do when authentication fails. |
| TLS | Encrypts the SMTP connection between sending and receiving servers to prevent interception in transit. |
What Can Go Wrong at Each Stage
Submission Errors
Submission Errors
The API request may be rejected before the message ever enters the sending queue. Common causes include invalid recipient addresses, missing required fields, unverified sending domains, or account-level rate limits. Lettr returns an immediate error response with details so your application can handle the failure.
DNS Failures
DNS Failures
If the recipient domain has no MX records, has misconfigured DNS, or if DNS resolution times out, Lettr cannot determine where to deliver the message. These failures typically result in a bounce with a descriptive error. Transient DNS issues may cause Lettr to retry delivery automatically.
SMTP Rejections
SMTP Rejections
The receiving mail server may refuse the connection or reject the message outright. This can happen due to IP blocklisting, the recipient mailbox not existing (hard bounce), or the receiving server being temporarily unavailable (soft bounce). SMTP response codes indicate the specific reason.
Authentication Failures
Authentication Failures
If SPF, DKIM, or DMARC checks fail, the receiving server may reject the message or route it to spam. This typically happens when DNS records are not configured correctly for your sending domain. Lettr provides domain verification tools to help you set up authentication properly.
Spam Filtering
Spam Filtering
Even with perfect authentication, messages can be flagged as spam based on content characteristics, sender reputation, recipient engagement patterns, or a combination of all three. Spam filtering is the least predictable stage because each mailbox provider uses proprietary algorithms.
Mailbox Full or Inactive
Mailbox Full or Inactive
The recipient’s mailbox may be over its storage quota or the account may be inactive or disabled. These are typically reported as soft bounces (temporary) or hard bounces (permanent) depending on the provider’s response. Lettr automatically suppresses addresses that repeatedly hard bounce.
Delivery vs Deliverability
These two terms are often confused but represent fundamentally different things.| Term | Meaning |
|---|---|
| Delivery | The message was accepted by the receiving mail server. It did not bounce. |
| Deliverability | The message reached the recipient’s inbox specifically, rather than the spam folder or another location. |
A 100% delivery rate does not mean a 100% inbox placement rate. A message can be successfully delivered but still land in spam. Delivery is a technical outcome. Deliverability is a quality outcome.
The Role of an Email Service Provider
Sending email directly from your own servers is technically possible, but introduces significant operational challenges. This is why applications use an email service provider like Lettr.IP Reputation Management
Lettr maintains a pool of sending IPs with established reputations, and provides dedicated IP options for high-volume senders. Building and maintaining IP reputation from scratch takes weeks or months.
DKIM Infrastructure
Lettr handles key generation, rotation, and signing automatically. You configure a single DNS record and Lettr manages the cryptographic operations for every message.
Bounce Handling
Lettr parses bounce responses, classifies them by type, automatically suppresses invalid addresses, and surfaces the data through webhooks and your dashboard so your application can respond.
Compliance
Lettr enforces suppression list processing, provides unsubscribe mechanisms, and handles feedback loops with major mailbox providers — helping you stay compliant with CAN-SPAM, GDPR, and other regulations.
Email Lifecycle Events
Every message that passes through Lettr generates a series of events that track its progress from submission to final outcome. These events are available through Lettr webhooks.| Event | Description |
|---|---|
| Injected / Queued | The message has been accepted by Lettr and is queued for sending. |
| Delivered | The receiving mail server accepted the message. |
| Bounced | The message was permanently rejected (hard bounce) or temporarily failed (soft bounce). |
| Deferred | Delivery was temporarily delayed and Lettr will retry automatically. |
| Opened | The recipient opened the message (tracked via pixel, where supported). |
| Clicked | The recipient clicked a link in the message (tracked via redirect, where enabled). |
| Complained | The recipient marked the message as spam via their mailbox provider’s feedback loop. |
| Unsubscribed | The recipient used the unsubscribe mechanism (List-Unsubscribe header or in-body link). |
Related Topics
SPF, DKIM & DMARC
Deep dive into the three email authentication protocols and how to configure them.
Bounce Codes Reference
Complete reference of SMTP bounce codes and what they mean for your sending.
Deliverability Best Practices
Actionable strategies for maximizing inbox placement rates.
Sending with Lettr
Get started sending email through the Lettr platform.