> 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-ja/conversations/email.md).

# 対話プラットフォーム連携：Email

## 連携前の確認 <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 %}

## 連携を開始する <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> をクリックします。

<figure><img src="/files/Z5NSuleRlCyrXkphDORk" alt=""><figcaption><p>Email 連携設定画面</p></figcaption></figure>

### 3. メールサービスプロバイダーを選択する <a href="#step-select-email-provider" id="step-select-email-provider"></a>

<mark style="color:blue;">メールサービスプロバイダー</mark> のドロップダウンメニューから選択します：

| プロバイダー                   | 説明                                               |
| ------------------------ | ------------------------------------------------ |
| **Gmail**                | Google のメール。アプリパスワードの使用が必要です                     |
| **Outlook / Office 365** | Microsoft のメール。2 段階認証を有効にしている場合はアプリパスワードの使用が必要です |
| **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 アシスタント**   | 紐付ける AI アシスタントを選択します        |
| **ポーリング間隔**     | （任意）システムが新着メールを確認する頻度（秒）    |
| **リセットコマンド**    | （任意）ユーザーが対話を最初からやり直すためのコマンド |

設定に問題がないことを確認したら、<mark style="color:blue;">保存</mark> をクリックして連携を完了します。

連携が完了すると、誰かがそのメールアドレス宛てにメールを送信した際に、AI アシスタントが自動的にメールの内容を読み取り、返信します。

{% hint style="info" %}
連携が成功すると、対話プラットフォームの一覧でこの連携を見つけることができます。編集をクリックすると、機能オプション（時間帯別の返信、送信者名の認識、権限管理など）をさらに設定できます。
{% 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-ja/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.
