# Email

## What it is

The **Email** channel lets people write to a special address (or your mailbox). Letters appear as chats in Botconsole, and the constructor can answer by email — useful for support, applications, and simple mail bots.

Email is not a messenger: there are no real “buttons under the message”, and delivery depends on mail providers and spam filters.

## Requirements

- A **constructor bot** in Botconsole  
- Either:
  - **Unique inbound address** mode (forward mail there / ESP inbound), or  
  - **IMAP** access to a mailbox (for example Gmail with an App Password)  
- A sensible **From** name and address for replies  

## How to connect

### Option A — Unique address (webhook / forward)

1. **Bots** → **Settings** → **Add connection** → **Email**.
2. Mode: **Unique address**.
3. Copy the **Inbound address** and (if needed) the **Webhook URL**.
4. Forward mail from your usual mailbox to the inbound address, **or** point your email provider’s inbound route to the webhook.
5. Set **From address** and **From name** for outgoing replies.
6. Optionally tune **inbound filters** (newsletters, promo domains, allowlists).
7. **Save**. Status should show that setup is ready.

### Option B — IMAP (Gmail / mailbox)

1. Same connection → mode **IMAP**.
2. Choose provider (Gmail, Outlook, Yandex, Mail.ru, or custom).
3. Enter login and **App Password** (Gmail requires 2FA + App Password — normal password often fails).
4. Set folder (usually `INBOX`) and From fields.
5. **Save**. New mail after connecting is polled about once a minute.

> For local or test projects without real MX, IMAP or a manual webhook test is easier than a public unique domain.

## Message types and limits

### Available message types

| Type | Supported | Notes |
|------|-----------|--------|
| Text | Yes | Main body of the email |
| Image | Yes | As attachment / inline depending on delivery |
| Document | Yes | Attachments |
| Video, audio, sticker, location, poll… | No | Prefer links in the text |

### Buttons

- **No interactive buttons** in the email client  
- If the scenario uses buttons, they are turned into **numbered plain-text options** in the letter body  
- Users reply with normal email text (or you guide them to write “1”, “2”, …)

### Extra message options

| Option | Available |
|--------|-----------|
| Reply in the same thread | Yes (threading) |
| Message effects | No |
| AI streaming | No |
| Edit / delete sent mail | No |
| Messenger keyboards | No |

### Limits

| Limit | Value |
|-------|--------|
| Body text | very large (tens of thousands of characters) |
| Subject | up to **200** characters |
| Attachments | about **20 MB** total (providers may be stricter) |

## Formatting

Simple formatting is possible:

- **Bold**, *italic*  
- Inline code  
- Links  

Complex Telegram-only markup may be flattened to HTML or plain text.

## Notes and limitations

> Set filters carefully if you connect a personal mailbox — otherwise newsletters can create noise chats. Prefer **allowlist** modes for personal Gmail.

> Avoid mail loops (auto-forwarding the same address back into itself).

> Email is slower than messengers. Users may wait minutes; keep scenarios short and clear.

> Outbound “From” should use an address you are allowed to send from (domain reputation / provider rules).
