> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyreach.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Email channel overview

> Let an agent answer real email with full threading and delivery tracking.

The email channel lets an agent receive and reply to real email. Inbound mail is parsed, routed to an agent by recipient address, threaded to a conversation using RFC `Message-ID` headers, and answered as a reply — with per-message delivery status and unsubscribe compliance handled for you. Email is sent and received through Resend.

## The model

Four objects make up the email layer:

| Object             | What it is                                                                                                                                      |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Email domain       | A sending/receiving domain registered with the provider. Either the shared default `agents.anyreach.ai` or a custom domain you verify with DNS. |
| Email address      | A specific address (for example `support@yourco.com`) that routes inbound mail to one agent version.                                            |
| Agent email config | Per-channel `email` properties on the agent version that control how replies are rendered (subject, signature, format, CC policy, footers).     |
| Unsubscribe ledger | An org-wide opt-out list, keyed by channel and address, that suppresses outbound sends to contacts who opted out.                               |

## How it flows

```
Inbound email ─▶ Resend webhook ─▶ route by recipient address ─▶ thread by Message-ID
                                                                        │
                                                                        ▼
                                                         agent answers as a reply
                                                                        │
                                                                        ▼
                                  Resend send ─▶ per-message delivery status
```

<Steps>
  <Step title="Verify a domain (or use the default)">
    Every default address is `<name>@agents.anyreach.ai`, which works with no setup. To send and receive on your own domain, register it and verify the DNS records the provider returns. See [Connecting a domain](/email/connecting-a-domain).
  </Step>

  <Step title="Create an email address">
    Create an address on a verified domain and point its `inbound_agent_version_id` at the agent version that should answer it. An address can route to exactly one agent. See [Email addresses](/email/email-addresses).
  </Step>

  <Step title="Configure the agent's email behavior">
    Set the `email` block in the agent version's per-channel properties to control reply subject, body format, signature, CC policy, and footers. See [Configuring an email agent](/email/configuring-an-email-agent).
  </Step>

  <Step title="The agent answers inbound email">
    Incoming mail is matched to its conversation by `In-Reply-To` / `References` headers, the agent generates a reply, and the send is tracked through to delivery.
  </Step>
</Steps>

## Routing

Inbound mail is routed by the address it was delivered to. Anyreach checks `Delivered-To` first, then the visible `To` and `Cc` recipients, and routes to the first address that resolves to an enabled agent. If the matched address is only in `Cc` (not `To`), the agent treats it as a CC'd participant rather than the primary recipient.

A reply is sent only when an address matches an agent. Auto-generated mail — anything carrying `List-Id`, `List-Unsubscribe`, or `X-Auto-Response-Suppress` — is detected and not answered, so the agent never replies to mailing lists or autoresponders.

## Threading

Replies stay in the same email thread. Each inbound message is matched to its existing conversation by the RFC `Message-ID` values in its `In-Reply-To` and `References` headers; when a match is found, the message joins that conversation, and the outbound reply carries the correct threading headers, subject, and participant list so it lands in the recipient's existing thread.

## Suppression and compliance

Anyreach keeps a single org-wide unsubscribe ledger. Each row records a `channel`, an `address`, and a `reason`, with one entry per `(organization_id, channel, address)`. Because the ledger is keyed by channel, opt-outs are tracked across channels rather than per agent. Outbound email replies append an unsubscribe footer by default (`include_unsubscribe_footer`), and removing a ledger row resubscribes that contact.

Manage opt-outs through the `/core/unsubscribes` endpoints (scopes `unsubscribes:read` and `unsubscribes:manage`). See [Unsubscribes and compliance](/email/unsubscribes-and-compliance).

## Delivery status

Every outbound message has a normalized delivery state, independent of the provider's own event vocabulary. Resend webhook events map onto a fixed ladder:

| State       | Meaning                                    |
| ----------- | ------------------------------------------ |
| `queued`    | Accepted by the provider, not yet sent.    |
| `sent`      | Handed off to the recipient's mail server. |
| `delivered` | Accepted by the recipient's mail server.   |
| `opened`    | The recipient opened the message.          |
| `clicked`   | The recipient clicked a link.              |
| `bounced`   | The message bounced.                       |
| `complaint` | The recipient marked it as spam.           |
| `failed`    | The send failed.                           |

`queued` → `sent` → `delivered` → `opened` → `clicked` advances monotonically; `bounced`, `complaint`, and `failed` are terminal. See [Delivery status](/email/delivery-status).

## Next steps

<CardGroup cols={2}>
  <Card title="Connect a domain" icon="globe" href="/email/connecting-a-domain">
    Register a custom sending/receiving domain and verify its DNS records.
  </Card>

  <Card title="Email addresses" icon="at" href="/email/email-addresses">
    Create addresses and route each one to an agent version.
  </Card>

  <Card title="Configure an email agent" icon="sliders" href="/email/configuring-an-email-agent">
    Set reply subject, body format, signature, CC policy, and footers.
  </Card>

  <Card title="Threading and replies" icon="reply" href="/email/threading-and-replies">
    How inbound mail is matched to a conversation by Message-ID.
  </Card>

  <Card title="Unsubscribes and compliance" icon="ban" href="/email/unsubscribes-and-compliance">
    Manage the org-wide opt-out ledger and unsubscribe footers.
  </Card>

  <Card title="Delivery status" icon="circle-check" href="/email/delivery-status">
    Track each message from queued through delivered, opened, or bounced.
  </Card>
</CardGroup>
