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

# Outlook Mail Integration: Email for Agents

> Agents can read, send, and organize email in Microsoft 365 mailboxes. OAuth tokens are managed and refreshed automatically.

<Note>Outlook Mail is available on the Cloud plan only.</Note>

## Overview

OneCLI 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.

## Setup

<Steps>
  <Step title="Go to Connections">
    Open the OneCLI dashboard and navigate to **Connections** > **Outlook Mail**.
  </Step>

  <Step title="Authorize">
    Click **Connect Outlook**. You'll be redirected to Microsoft to sign in and authorize OneCLI. Review the permissions and click **Accept**.
  </Step>
</Steps>

## 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) 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) add guardrails on top, like rate limits and blanket blocks. Everything is checked before credential injection, so a blocked request never reaches Microsoft Graph.
