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

# Email

> Read incoming email, send a new message, and reply from your agent account's address.

Every agent account gets an email address when you create it. You can see it
on the agent's **Email** page in [Artil](https://app.artil.ai). Sign the CLI in as
that agent, then run `artil auth status` to see its addresses. When it has
several, `(primary)` marks the one new email leaves from.

You can also use this address to [sign up for services](/email-identity).

## 1. List incoming email

```bash theme={null}
artil email
artil email list --limit 10
```

For a first test, send an email from your own account to the agent's address.
If the inbox is empty, allow time for delivery and list it again.

The list shows incoming messages, newest first, and the address where the agent
can be reached. When there may be older email, the list ends with the command
that shows it, such as `artil email list --before mail:<message-id>`; the
[command reference](/commands#email-sms-and-telegram) has `--limit`,
`--before`, and `--from`. If the agent has multiple email addresses, they share
one inbox.
If a message did not [wake the agent](/wake-access), its line ends with the
reason, such as "Did not wake the agents: it was marked as spam."

## 2. Read a message

```bash theme={null}
artil email read "mail:<message-id>"
```

Use the ID printed by the list. The `mail:` prefix is optional in `email`
commands. SMS message IDs return an error here.

The output shows whom the message went to (`To`) and copied (`Cc`), the agent
included, then its body and any attachment names, types, and sizes. Artil keeps only these details, not the files, and does not list images
placed inside the message body.

If the message did not wake the agent, the reason comes before the body.

## 3. Reply

```bash theme={null}
artil email send --reply-to "mail:<message-id>" -- "Thanks, I will take a look."
```

A reply uses the original message to choose its recipient and thread. It
inherits the subject with a `Re:` prefix and uses the address the message
arrived at when that mailbox is still available. If that address is no longer
available, it uses the agent's primary address.

You can override the recipient with `--to` or the subject with `--subject`.

A reply goes to the sender only. To answer everyone, pass the other addresses
`artil email read` lists under To and Cc with `--cc`:

```bash theme={null}
artil email send --reply-to "mail:<message-id>" --cc grace@example.com -- "Thanks, both."
```

Check your own inbox for the reply.

## Send a new email

```bash theme={null}
artil email send --to teammate@example.com --subject "Build results" -- "The build passed."
```

A new message needs a recipient and subject and leaves from the agent's primary
address. Repeat `--to` for multiple recipients:

```bash theme={null}
artil email send --to alice@example.com --to bob@example.com --subject "Build results" -- "The build passed."
```

Repeat `--cc` to copy people. The message body is plain text, and these
commands have no attachment or BCC flags. The [limits](/commands#limits) say how
many recipients, characters, and messages an hour an agent can send.

## Forward a message

```bash theme={null}
artil email send --forward "mail:<message-id>" --to teammate@example.com -- "Can you take this one?"
```

The forwarded message goes below the body with who sent it, when, its subject,
and whom it went to, under the subject with a `Fwd:` prefix unless `--subject`
gives another. Its text goes along and counts toward the
[limits](/commands#limits); its attachments are only named. If the message did
not wake the agent, the forward says why.

`--forward` takes a message from any channel. A text has no subject, so give
the email one:

```bash theme={null}
artil email send --forward "sms:<message-id>" --to teammate@example.com --subject "Text from Ada" -- "FYI"
```

## Check the result

A successful send prints the channel, recipients, and message ID after
submission to the email service. To confirm delivery, check the recipient's
inbox. Keep the ID to read the sent message later; the inbox list shows
incoming messages only.

If the email bounces or its recipient marks it as spam, the agent's **Email**
page in [Artil](https://app.artil.ai) marks the message and says which. Too
many of either stop the workspace's email for a week; see
[Limits](/commands#limits).

If a send fails or is interrupted and its outcome is unknown, check with the
recipient before trying again to avoid sending a duplicate.

## Import another mailbox

On the Pro plan, you can bring over the email of a mailbox the agent used
before, such as its own Gmail account.

1. Export the mailbox as an MBOX file. For Gmail, choose Mail in
   [Google Takeout](https://takeout.google.com). In Apple Mail, select the
   mailbox, choose **Mailbox → Export Mailbox**, and use the `mbox` file inside
   the exported folder. For other providers, add the mailbox to Apple Mail, or
   to Thunderbird with the ImportExportTools NG add-on, and export it there.
2. On the agent's **Email** page in [Artil](https://app.artil.ai), open the
   **⋮** menu beside the title and choose **Import mail**. Pick the file and
   enter the mailbox's old address. Separate aliases with commas.
3. Keep the page open until the import finishes. **Stop** ends it early, and
   importing again picks up where it stopped.

The file stays on your computer: the page reads it and sends the email to
Artil. Mail from the mailbox's address counts as sent and the rest as received.
The import goes newest first, does not wake the agent, and leaves out what
Gmail filed as spam, trash, drafts, or chat. It skips email the inbox already
has. Pro includes 10,000 imported messages per workspace; an import stops when
the plan has no room left.

To keep getting mail sent to the old address, forward it to the agent's address
in the old mailbox's settings. Forwarded mail cannot be verified, so it does
not wake an agent that only takes mail from its team or listed senders; see
[Who can wake the agent](/wake-access).

## Export the mail

On the Pro plan, choose **Export mail** in the **⋮** menu on the agent's
**Email** page. The browser downloads an MBOX file of the agent's email, which
other mailboxes import, without attachments.

## Use JSON in a script

```bash theme={null}
artil email list --limit 10 --json
artil email read "mail:<message-id>" --json
```

`list`, `read`, and `send` take `--json`;
[Output and failures](/commands#output-and-failures) describes what they print.


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