# Email

Read, send, reply, schedule and organize mail in an IMAP mailbox with the same email endpoints as Gmail and Outlook, and what works differently over IMAP.

## Send and read mail

Use the [Google email](/platforms/google/email) calls with an IMAP `accountId`: `POST /v1/email/messages` to send, `GET /v1/email/messages` and `GET /v1/email/threads` to read, `POST /v1/email/messages/{messageId}/reply` to reply.

Scheduled send, `holdAsDraft`, and open, click and reply tracking work the same way.

## How it behaves

- Message ids include the folder, so a moved message gets a new id. `PATCH` returns the new one.
- A thread is every message that shares the first `Message-ID` of its `References`. Listing threads groups the page's messages by conversation.
- `GET /v1/email/messages` reads the inbox unless you pass `folder`, such as `sent`, `drafts`, `archive` or a path from `GET /v1/email/folders`.
- Sent mail is filed in the Sent folder. Providers that file it themselves are not given a second copy.
- New inbox mail is polled every minute, so `message.received` arrives one to two minutes late.
- A held draft that the user edits in their mail app is sent as edited when the app keeps its `Message-ID`.

## If it fails

| Error | Cause | Fix |
|-------|-------|-----|
| `400` on labels | IMAP mailboxes have no labels | Move mail between folders with `folder` |
| `409 account_reconnect_required` | The stored password stopped working | Send the user to `details.reconnectUrl` |
| `404` after a move | The message id changed | Use the id `PATCH` returned |

## Related

- [Connect](/platforms/imap/connect)
- [Webhooks](/platforms/imap/webhooks)