> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/conversations/email.md).

# Integrate with Platform: Email

## Pre-Connection Checklist

* An "AI Assistant" has been created on the [MaiAgent platform](https://admin.maiagent.ai/)
* An email account is ready for connection (Gmail, Outlook, Yahoo, or custom mail server)
* If using Gmail or Outlook, generate an **app-specific password** first (not your account password)

{% hint style="warning" %}
Gmail requires a 16-digit app-specific password; you cannot use your Google account password. Generate an app-specific password at [Google Account Security](https://myaccount.google.com/apppasswords).
{% endhint %}

## Start Connection

### 1. Go to the Connect Chat Platform Page

Click <mark style="color:blue;">Chat Platforms</mark> in the left menu, then click the <mark style="color:blue;">Connect Chat Platform</mark> button in the upper right corner.

### 2. Select Email

On the platform selection page, click <mark style="color:blue;">Email</mark>.

### 3. Select Email Service Provider

Choose from the <mark style="color:blue;">Email Service Provider</mark> dropdown menu:

| Provider                 | Description                                                                              |
| ------------------------ | ---------------------------------------------------------------------------------------- |
| **Gmail**                | Google email, requires an app-specific password                                          |
| **Outlook / Office 365** | Microsoft email, requires an app-specific password when two-step verification is enabled |
| **Yahoo Mail**           | Yahoo email, requires an app-specific password                                           |
| **Custom**               | Manually configure IMAP/SMTP server settings                                             |

After selecting a provider, the system automatically fills in the corresponding IMAP and SMTP server settings.

### 4. Enter Connection Details

#### Email Address

Enter the full email address to connect, e.g., `support@yourcompany.com`.

#### IMAP Settings (Receiving)

| Field           | Description                                                |
| --------------- | ---------------------------------------------------------- |
| **IMAP Server** | Incoming mail server address (for Gmail: `imap.gmail.com`) |
| **IMAP Port**   | Port number (typically 993)                                |
| **Use SSL**     | Recommended to enable for secure transmission              |

#### SMTP Settings (Sending)

| Field           | Description                                                |
| --------------- | ---------------------------------------------------------- |
| **SMTP Server** | Outgoing mail server address (for Gmail: `smtp.gmail.com`) |
| **SMTP Port**   | Port number (typically 587)                                |
| **Use TLS**     | Recommended to enable for secure transmission              |

#### Authentication Settings

| Field        | Description                                  |
| ------------ | -------------------------------------------- |
| **Username** | Usually the email address                    |
| **Password** | App-specific password (not account password) |

### 5. Test Connection

After filling in all fields, click the <mark style="color:blue;">Test Connection</mark> button. The system will simultaneously test both IMAP (receiving) and SMTP (sending) connectivity.

* **Connection successful**: Displays "Connection successful! IMAP and SMTP server connection tests passed"
* **Connection failed**: The system shows the specific error reason (authentication failure, server unreachable, etc.) — correct the settings based on the prompts

{% hint style="danger" %}
Always complete the connection test before saving to confirm that both IMAP and SMTP are working properly.
{% endhint %}

### 6. Basic Settings and Save

| Field                | Description                                                            |
| -------------------- | ---------------------------------------------------------------------- |
| **Platform Name**    | Give this connection a name                                            |
| **AI Assistant**     | Select the AI Assistant to bind                                        |
| **Polling Interval** | (Optional) Frequency in seconds for the system to check for new emails |
| **Reset Command**    | (Optional) A command that allows users to restart the conversation     |

After confirming all settings are correct, click <mark style="color:blue;">Save</mark> to complete the connection.

Once connected, when someone sends an email to that address, the AI Assistant will automatically read the email content and reply.

{% hint style="info" %}
After successful connection, you can find this integration in the chat platform list. Click edit to further configure feature options (time-based replies, sender name recognition, access control, etc.).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/conversations/email.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
