> ## 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 with rules

Use OneCLI's [rules engine](/guides/rules) to limit what agents can do with your email. For example, you can block send operations so agents can only read and draft, or restrict agents to specific mail folders. Rules are evaluated before credential injection, so a blocked request never reaches Microsoft Graph.
