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

# Email Channel

> Give your agent an email address and let it answer emails in the same thread.

Turn on email for an agent and it gets its own address. Anyone who writes to
that address gets an answer from the agent, in the same email thread. Each
thread becomes one conversation in your inbox, so you can follow it, take it
over and reply as a person.

## What you need

* An agent (draft or published).
* Email set up on your platform. If the page says **Email is not set up on this
  platform yet**, a platform admin has to add the email provider keys and the
  inbound domain first. See [Setup for platform admins](#setup-for-platform-admins).

## Turn on email

1. Open the agent and go to **Distribute**.
2. Click the **Email** card.
3. Switch on **Answer emails**.

The agent's address appears under the switch, for example
`acme-support-3f9a1@mail.example.com`. Click **Copy address** and share it, or
forward your support mailbox to it.

<Note>
  The address is created the first time you save and never changes, even if
  you turn email off and on again. It is never given to another agent.
</Note>

You can also turn email on while publishing a new agent: select **Email** under
**Publish channel**, then click **Turn on email** after you publish.

## Sender name

**From name** is the name customers see on replies. Leave it empty to use the
agent's name. Click **Save**.

## Who can email the agent

Under **Who can email this agent**, choose:

* **Anyone** — every sender gets an answer.
* **Only the addresses and domains I list** — enter one entry per line:
  * a full address, such as `ada@example.com`
  * a whole domain, such as `@example.com` (subdomains like
    `@eu.example.com` need their own entry)

Click **Save**. A sender who is not on the list gets one short reply per day
saying the address does not accept their messages, and nothing else.

## How replies work

* The agent answers in the **same thread**, with `Re:` on the subject. Every
  reply in that thread goes to the same conversation.
* A new email (a new subject, not a reply) starts a new conversation.
* The agent replies only to the person who wrote, never to everyone copied.
  If several people write in one thread, each has their own conversation.
* Replies are **plain text**. Sources from the knowledge base are listed at the
  end, like on WhatsApp.
* The agent's welcome message is added to the top of its first reply in a new
  thread.
* The agent reads only the newest part of each email. Quoted earlier messages
  and signatures are removed.

### Emails the agent never answers

To prevent loops and spam, the agent ignores:

* automatic replies (out-of-office, auto-responders) and bounce messages
* newsletters and mailing lists
* `no-reply` and similar senders
* other agents on the platform
* more than 20 emails an hour from one sender

## Attachments

The agent reads attachments only when the agent's **File upload** tool is on
(**Tools** tab). Up to 5 files per email, 25 MB each.

* **File upload off** — the reply says the agent cannot open attachments, then
  answers from the text.
* **File upload on** — the agent reads supported files. If it cannot use a
  file, the reply says so and answers without it.

Images inside the email body, such as signature logos, are ignored.

## Human takeover

Email conversations appear in **Conversations** with the channel **Email**.
When an operator takes over:

* New customer emails in that thread appear in the conversation, and the agent
  stops answering.
* The operator's replies are sent by email into the customer's thread, from the
  agent's address and sender name.
* When the conversation is resolved, the agent answers again.

Email sends only real answers: the agent's replies and your operators'
replies. Status notices are not emailed. That covers "All operators are
currently busy", "Our team is currently offline", "An operator has joined the
conversation", "pending review" notices and the "no operator was available"
note. Web chat and WhatsApp still show them.

This means that after the agent hands a conversation to your team, the customer
gets no email until an operator replies. Answer escalated email conversations
promptly. If an answer needs approval, the customer gets the approved answer
when it is approved, and nothing before.

## Credits

Email can carry two platform fees, set by your platform admin: one for each
email the agent answers, and one for each reply sent (by the agent or by an
operator). The AI's own usage is charged as on every channel. Ledger entries
read **Email received** and **Email reply sent**.

## Turn email off

Switch off **Answer emails** and confirm. Emails to the address get no answer.
The address stays reserved for this agent.

## Setup for platform admins

These steps are done once per platform, outside Brainstormer, then in the admin
settings:

1. In Resend, add your inbound domain (for example `mail.example.com`), turn on
   receiving and create the MX record it shows you.
2. Add Resend's SPF and DKIM records and a DMARC record for the same domain, so
   replies are not marked as spam.
3. In Resend → Webhooks, add `https://<your API host>/api/public/channels/email/webhook`
   for the **email.received** event. Copy the signing secret.
4. In **Admin → System Config**, set **Resend Email Channel API Key**, **Resend
   Email Webhook Secret** and **Email Inbound Domain**.
5. Optional: set **Email — Credits per Inbound Message** to `1` and **Email —
   Credits per Reply** to `2` to charge the email fees.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.