> 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/build/choose-channel/email.md).

# 串接對話平台：Email

串接 Email 對話平台：設定收發信帳號（Gmail 需應用程式專用密碼）、綁定 Agent，讓 Agent 自動回覆來信的步驟與限制。

## 串接前確認 <a href="#pre-integration-checklist" id="pre-integration-checklist"></a>

* 已在 [MaiAgent 平台](https://admin.maiagent.ai/)上建立好一個「AI 助理」
* 已準備好要串接的電子郵件帳號（Gmail、Outlook、Yahoo 或自訂郵件伺服器）
* 若使用 Gmail 或 Outlook，需先產生**應用程式專用密碼**（非帳號密碼）

{% hint style="warning" %}
Gmail 必須使用 16 位數的應用程式專用密碼，無法使用 Google 帳號密碼登入。請先至 [Google 帳號安全性](https://myaccount.google.com/apppasswords) 產生專用密碼。
{% endhint %}

## Email 對話平台做什麼、不做什麼 <a href="#scope-and-limits" id="scope-and-limits"></a>

Email 對話平台是「收信 → Agent 自動回信」：MaiAgent 用 IMAP 收取寄到這個信箱的新郵件，交給綁定的 Agent 產生回覆，再用 SMTP 回信給寄件人；每封來信與回覆都會出現在 <mark style="color:blue;">所有對話</mark>，客服也能在那裡接手回覆。它不會把信箱裡的既有郵件匯入，使用者也不能在對話中搜尋或查詢這個信箱的內容。

要在對話中查信、摘要郵件或代擬回覆，請改用 MaiGPT 的 [連接器](/work/maigpt/connectors.md) 把 Google Workspace（Gmail）或 Microsoft 365（Outlook）接進來；可用的連接器以組織的連接器選單為準。

## 開始串接 <a href="#start-integration" id="start-integration"></a>

### 1. 進入串接對話平台頁面 <a href="#step-go-to-channel-page" id="step-go-to-channel-page"></a>

在左側選單點選 <mark style="color:blue;">對話平台</mark>，點擊右上角 <mark style="color:blue;">串接對話平台</mark> 按鈕。

### 2. 選擇 Email <a href="#step-select-email" id="step-select-email"></a>

在平台選擇頁面中，點擊 <mark style="color:blue;">Email</mark>。

### 3. 選擇郵件服務商 <a href="#step-select-email-provider" id="step-select-email-provider"></a>

從 <mark style="color:blue;">郵件服務商</mark> 下拉選單中選擇：

| 服務商                      | 說明                               |
| ------------------------ | -------------------------------- |
| **Gmail**                | Google 信箱，需使用應用程式專用密碼            |
| **Outlook / Office 365** | Microsoft 信箱，啟用兩步驟驗證時需使用應用程式專用密碼 |
| **Yahoo Mail**           | Yahoo 信箱，需使用應用程式專用密碼             |
| **自訂**                   | 自行設定 IMAP/SMTP 伺服器參數             |

選擇服務商後，系統會自動填入對應的 IMAP 和 SMTP 伺服器設定。

### 4. 填寫連線資訊 <a href="#step-fill-connection-info" id="step-fill-connection-info"></a>

#### 電子郵件地址 <a href="#email-address" id="email-address"></a>

輸入要串接的完整郵件地址，例如 `support@yourcompany.com`。

#### IMAP 設定（收信） <a href="#imap-settings" id="imap-settings"></a>

| 欄位            | 說明                                |
| ------------- | --------------------------------- |
| **IMAP 伺服器**  | 收信伺服器位址（Gmail 為 `imap.gmail.com`） |
| **IMAP Port** | 連接埠號（通常為 993）                     |
| **使用 SSL**    | 建議開啟以確保傳輸安全                       |

#### SMTP 設定（寄信） <a href="#smtp-settings" id="smtp-settings"></a>

| 欄位            | 說明                                |
| ------------- | --------------------------------- |
| **SMTP 伺服器**  | 寄信伺服器位址（Gmail 為 `smtp.gmail.com`） |
| **SMTP Port** | 連接埠號（通常為 587）                     |
| **使用 TLS**    | 建議開啟以確保傳輸安全                       |

#### 認證設定 <a href="#authentication-settings" id="authentication-settings"></a>

| 欄位        | 說明              |
| --------- | --------------- |
| **使用者名稱** | 通常為電子郵件地址       |
| **密碼**    | 應用程式專用密碼（非帳號密碼） |

### 5. 測試連線 <a href="#step-test-connection" id="step-test-connection"></a>

填寫完成後，點擊 <mark style="color:blue;">測試連線</mark> 按鈕。系統會同時測試 IMAP（收信）和 SMTP（寄信）的連線狀況。

* **連線成功**：顯示「連線成功！IMAP 和 SMTP 伺服器連線測試通過」
* **連線失敗**：系統會顯示具體的錯誤原因（認證失敗、伺服器無法連線等），請根據提示修正設定

{% hint style="danger" %}
請務必在儲存前完成連線測試，確認 IMAP 和 SMTP 均可正常連線。
{% endhint %}

### 6. 基本設定與儲存 <a href="#step-basic-settings-and-save" id="step-basic-settings-and-save"></a>

| 欄位         | 說明                |
| ---------- | ----------------- |
| **對話平台名稱** | 為此串接取一個名稱         |
| **AI 助理**  | 選擇要綁定的 Agent      |
| **輪詢間隔**   | （選填）系統檢查新郵件的頻率（秒） |
| **重置指令**   | （選填）讓使用者重新開始對話的指令 |

確認設定無誤後，點擊 <mark style="color:blue;">儲存</mark> 完成串接。

串接完成後，當有人寄信至該郵件地址時，Agent 會自動讀取郵件內容並回覆。

{% hint style="info" %}
串接成功後，您可以在對話平台列表中找到此串接，點擊編輯可進一步設定功能選項（時段回覆、寄件人名稱感知、權限控管等）。
{% endhint %}

## 來信附件怎麼處理 <a href="#email-attachments" id="email-attachments"></a>

來信的附件（含 HTML 內文裡的內嵌圖片）會存成該則訊息的附件，處理方式和使用者在 Web Chat 上傳檔案相同：

| 附件類型                                               | Agent 怎麼讀                                                                                                                         |
| -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| 圖片（`.png`、`.jpg`、`.gif`、`.webp` 等）                 | 直接交給 Agent 的語言模型判讀，Agent 必須使用支援多模態的模型；開啟功能設定的 <mark style="color:blue;">啟用 OCR</mark> 可辨識圖片中的文字                                   |
| 文件（PDF、Word、Excel、CSV、PowerPoint、TXT 等知識庫支援的格式）與音訊 | **Agent 必須使用 Agent 模式**：Agent 會依來信內容決定要不要用附件工具解析檔案、讀取全文或建立索引，再據以回覆；Excel／CSV 會轉成表格文字，可以回答欄位值，音訊會先轉成逐字稿。其他回答模式只會保留附件檔案，Agent 讀不到內容 |

* 解析在 Agent 回覆時進行，附件多或檔案大時第一封回信會比較慢；解析費用依知識庫的解析器規則計入 Credits。
* 附件只屬於這段對話，不會進入知識庫；保留天數依平台的附件清理設定，到期後附件與解析副本會自動刪除，見 [Credits 計費制度](/others/credits.md#attachment-and-derived-storage)。
* 附件工具可在 Agent 的進階設定個別關閉，見 [為 Agent 配置工具](/build/tools/configure_tools.md)；處理細節見[技術人員手冊 - 訊息附件怎麼被處理](https://docs.maiagent.ai/tech/api-integration/api_knowledge#attachment-processing)。

## 郵件內容可以匯出嗎 <a href="#email-export" id="email-export"></a>

Email 對話平台沒有「匯出成 PDF／Excel」的功能，Agent 也不會把來信內容轉成檔案。來信與回信都會成為對話紀錄，可在 [所有對話](/serve/daily-operations/reply.md) 查看，或在 [Agent 監控](/build/agent-ops/evaluations.md) 篩選後批次匯出成 Excel（見[對話檢視器：批次匯出](/serve/daily-operations/reply/conversation-viewer.md#batch-export)）。要把單封郵件的內容整理成文件，可以請 Agent 以 [Canvas](/work/maigpt/canvas.md#export) 產出後下載。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/build/choose-channel/email.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
