> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect AI Agents to Outlook Mail in Microsoft 365

> Let agents read, search, send, and organize Outlook email in Microsoft 365. The gateway injects and refreshes OAuth tokens so agents never see them.

> [!NOTE]
>
> On self-hosted Buckle, Outlook Mail needs your own Microsoft app first. See [Self-hosted](#self-hosted).

## Overview

Buckle connects AI agents to Outlook Mail through Microsoft's OAuth flow. Agents can read your inbox, send emails, manage folders, and search messages. The gateway injects OAuth credentials into requests to the Microsoft Graph API automatically.

This is useful for agents working in Microsoft 365 environments that need to process emails, send notifications, or automate inbox management.

## What you will set up

* An Outlook Mail connection through Microsoft OAuth
* Automatic token injection on requests to Microsoft Graph
* Per-agent, per-tool access, such as read freely and approve sends

## Setup

**1. Open the app**

Open the Buckle dashboard and navigate to **Settings** > **Apps** > **Outlook Mail**.

**2. Authorize**

Click **Connect Outlook**. You'll be redirected to Microsoft to sign in and authorize Buckle. Review the permissions and click **Accept**.

![Buckle connect window for Outlook Mail on Cloud, showing the Connect to Outlook Mail button.](https://mintcdn.com/onecli-17d3f772/h1DTAVlDkLshz4JZ/images/integrations/outlook-mail/buckle-connect-outlook-mail.png?fit=max\&auto=format\&n=h1DTAVlDkLshz4JZ\&q=85\&s=d7af5acf40805e3f22cabea91e21de30)

The Outlook Mail connect window on Buckle Cloud.

## Self-hosted: use your own Microsoft app

> [!NOTE]
>
> **Skip this section on Buckle Cloud.** It's only for self-hosted Buckle without `MICROSOFT_CLIENT_ID` and `MICROSOFT_CLIENT_SECRET` set. One Microsoft app serves Outlook Mail, Outlook Calendar, Microsoft Word, and Microsoft OneNote, so you set it up once.

> [accordion] 1. Register the app
>
> In the [Microsoft Entra admin center](https://entra.microsoft.com/), open **Entra ID** > **App registrations** > **New registration**. Name it `Buckle` and, under **Supported account types**, choose **Any Entra ID Tenant + Personal Microsoft accounts**.

> [accordion] 2. Add the redirect URI
>
> In Buckle, open **Settings** > **Apps** > **Outlook Mail** > **Custom credentials** and copy the **Redirect URI**. In the registration form, set the platform to **Web**, paste the URI, and select **Register**.
>
> ![Microsoft Entra Register an application form with the name Buckle, Supported account types set to Any Entra ID Tenant + Personal Microsoft accounts, and a Web redirect URI.](https://mintcdn.com/onecli-17d3f772/h1DTAVlDkLshz4JZ/images/integrations/outlook-mail/01-entra-register.png?fit=max\&auto=format\&n=h1DTAVlDkLshz4JZ\&q=85\&s=9675e58139214734efe72dad8e52f740)
>
> The registration form: account type and the Web redirect URI.
>
> ![Buckle Custom credentials card for Outlook Mail with the setup guide link, the Redirect URI and its copy button, and the client ID and secret fields.](https://mintcdn.com/onecli-17d3f772/h1DTAVlDkLshz4JZ/images/integrations/outlook-mail/buckle-custom-credentials-outlook-mail.png?fit=max\&auto=format\&n=h1DTAVlDkLshz4JZ\&q=85\&s=4cc72784c3ea85e8a33351137c4fc035)
>
> Copy the Redirect URI from Custom credentials in Buckle.

> [accordion] 3. Add the API permissions
>
> Open **API permissions** > **Add a permission** > **Microsoft Graph** > **Delegated permissions** and add:
>
> | App | Permissions |
> | - | - |
> | All | `User.Read`, `offline_access` |
> | Outlook Mail | `Mail.ReadWrite`, `Mail.Send` |
> | Outlook Calendar | `Calendars.ReadWrite` |
> | Microsoft Word | `Files.ReadWrite` |
> | Microsoft OneNote | `Notes.Read`, `Notes.ReadWrite`, `Notes.Create` |
>
> ![Microsoft Entra API permissions page listing Microsoft Graph delegated permissions including Mail.ReadWrite, Mail.Send, Calendars.ReadWrite, Files.ReadWrite, the Notes permissions, offline\_access, and User.Read, all granted.](https://mintcdn.com/onecli-17d3f772/h1DTAVlDkLshz4JZ/images/integrations/outlook-mail/02-entra-api-permissions.png?fit=max\&auto=format\&n=h1DTAVlDkLshz4JZ\&q=85\&s=672dd51af7485197f629c4086906a215)
>
> API permissions after adding the Microsoft Graph delegated permissions. Extra ones such as openid and email are harmless.

> [accordion] 4. Connect with your app
>
> Copy the **Application (client) ID** from **Overview**. Open **Certificates & secrets** > **New client secret** and copy its **Value** (shown once). Paste both into **Settings** > **Apps** > **Outlook Mail** > **Custom credentials**, select **Save credentials**, then **Connect** and accept in Microsoft.

## What agents can do

* Search messages by sender, subject, body content, date range, or folder
* Read the full content of emails, including attachments
* Send new emails with recipients, subject, body, and attachments
* Reply to or forward messages
* Create, rename, and delete mail folders
* Move messages between folders
* Mark messages as read or unread
* Flag messages for follow-up
* List and manage inbox rules
* Read and manage focused inbox preferences

## Controlling access

Access is per agent: [grant](/docs/guides/agent-access.md) the connection to each agent that needs it, choosing per tool what runs freely, what needs human approval, and what stays blocked — a read-only agent is a single grant. Organization [rules](/docs/guides/rules.md) add guardrails on top, like rate limits and blanket blocks. Everything is checked before credential injection, so a blocked request never reaches Microsoft Graph.

## FAQ

> [accordion] Can an agent read Outlook mail without sending?
>
> Yes. When you [grant](/docs/guides/agent-access.md) the connection, allow the read tools and block or require approval for sending.

> [accordion] Does the agent see my Microsoft token?
>
> No. The token stays in Buckle, and the gateway adds it to Microsoft Graph requests at the proxy. See [How it works](/docs/how-it-works.md).

> [accordion] Does one Microsoft app cover Outlook Calendar and Word too?
>
> Yes, on self-hosted. One Microsoft app serves Outlook Mail, Outlook Calendar, Microsoft Word, and Microsoft OneNote. See [Self-hosted](#self-hosted).

> [accordion] How do I reconnect Outlook Mail?
>
> Open **Settings** > **Apps** > **Outlook Mail** and connect again. Agents with access use the new connection automatically.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.