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

# Email Tools

> Email management tools including Gmail, Outlook, and Zoho Mail with functions and triggers.

Rilo provides comprehensive email management tools for sending, receiving, and organizing emails across multiple email platforms. These tools enable automated email workflows, contact management, and email organization.

## Available Tools

* **Gmail** - Google's email service with spam protection, search, and G Suite integration
* **Outlook** - Microsoft's email and calendaring platform with unified workspace
* **Zoho Mail** - Secure, ad-free email hosting with collaboration tools and admin controls

## Gmail

Gmail is Google's email service featuring spam protection, powerful search functions, and seamless integration with other G Suite apps for productivity.

### Authentication

Requires authentication with `gmail` integration.

### Available Functions

Gmail provides 28 functions for comprehensive email management:

| Function                      | Description                                                                                                                                                                                             |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `send_email`                  | Send a new email immediately to one or more recipients. Supports HTML body with inline CSS, file attachments, CC, BCC, and extra recipients. Returns the sent message ID for tracking.                  |
| `create_email_draft`          | Create an email draft that can be reviewed and edited before sending. Supports threading via thread\_id, attachments, and full recipient options. Useful for approval workflows.                        |
| `send_draft`                  | Send an existing draft immediately. Use when draft has been reviewed and approved. Takes draft\_id from create\_email\_draft or list\_drafts.                                                           |
| `reply_to_thread`             | Reply within a Gmail thread maintaining conversation context. Requires thread\_id from fetch\_message\_by\_thread\_id. Supports attachments and HTML formatting.                                        |
| `forward_message`             | Forward an email to specified recipients. Can add additional commentary text. Requires original message\_id.                                                                                            |
| `fetch_emails`                | Retrieve emails matching search criteria. Use gmail\_query config type for complex searches. Supports pagination via page\_token and max\_results. Can filter by labels and include/exclude spam/trash. |
| `fetch_message_by_message_id` | Get complete details of a specific email including headers, body, and attachment info. Use for processing individual emails after fetch\_emails returns IDs.                                            |
| `fetch_message_by_thread_id`  | Fetch all messages in an email thread. Returns complete conversation history with pagination support. Useful for context when replying.                                                                 |
| `list_threads`                | List email threads with optional Gmail query filtering. Returns thread IDs and snippets. Use for conversation-based email processing.                                                                   |
| `create_label`                | Create a new Gmail label with custom visibility settings and colors. Labels can be shown/hidden in label list and message list.                                                                         |
| `add_label_to_email`          | Add or remove labels from a message. Can apply multiple labels at once. Use for email organization and workflow automation.                                                                             |
| `remove_label`                | Permanently delete a user-created label. System labels like INBOX cannot be deleted. All emails keep their content but lose the label association.                                                      |
| `list_labels`                 | List all Gmail labels including system labels (INBOX, SENT, SPAM) and user-created labels. Returns label IDs needed for other operations.                                                               |
| `patch_label`                 | Update an existing label's properties including name, color, and visibility settings. Cannot modify system labels.                                                                                      |
| `modify_thread_labels`        | Add or remove labels on all messages within a thread simultaneously. More efficient than modifying messages individually.                                                                               |
| `batch_delete_messages`       | Permanently delete up to 1,000 messages in a single operation. Messages are permanently removed, bypassing trash. Use with caution.                                                                     |
| `batch_modify_messages`       | Modify labels on up to 1,000 messages at once. Efficient for bulk organization like moving all emails from a sender to a label.                                                                         |
| `get_contacts`                | Fetch contacts from the authenticated Google Contacts. Includes names, emails, and phone numbers. Supports pagination for large contact lists.                                                          |
| `get_people`                  | Retrieve detailed person information from Google Contacts. Returns profile data including organization, addresses, and custom fields.                                                                   |
| `search_people`               | Search contacts by name, email, or phone number. Useful for finding recipients when user provides partial information.                                                                                  |
| `list_drafts`                 | List all email drafts with pagination. Returns draft IDs and message snippets. Use before send\_draft to find specific drafts.                                                                          |
| `delete_draft`                | Permanently delete a draft. Cannot be undone. Use when draft is no longer needed or was sent via other means.                                                                                           |
| `delete_message`              | Permanently delete a single message, bypassing trash. Cannot be undone. For recoverable deletion, use move\_to\_trash instead.                                                                          |
| `move_to_trash`               | Move a message to Gmail trash. Message can be recovered within 30 days. Safer alternative to permanent deletion.                                                                                        |
| `get_profile`                 | Get Gmail profile information for the authenticated user. Returns email address and total message count.                                                                                                |
| `get_attachment`              | Download a specific email attachment by attachment\_id. Returns attachment data that can be saved or processed. Requires message\_id containing the attachment.                                         |
| `list_history`                | Track mailbox changes since a specific history ID. Useful for incremental sync to detect new messages, label changes, and deletions.                                                                    |
| `history_list`                | Alias for list\_history. Fetch mailbox change history for synchronization with external systems.                                                                                                        |

### Available Triggers

Gmail supports app event triggers for workflow automation:

| Trigger Slug              | Description                                                                                               |
| ------------------------- | --------------------------------------------------------------------------------------------------------- |
| `GMAIL_NEW_GMAIL_MESSAGE` | Triggered when a new email message is received in Gmail. Can be filtered by sender, subject, labels, etc. |

<Info>
  Use `get_tools_trigger_actions` to discover all available triggers for Gmail. Triggers can be filtered by sender, subject, labels, and other criteria.
</Info>

## Outlook

Outlook is Microsoft's email and calendaring platform integrating contacts and scheduling, enabling users to manage communications and events in a unified workspace.

### Authentication

Requires authentication with `outlook` integration.

### Available Functions

Outlook provides extensive functions for email, calendar, and contact management:

| Function                | Description                                                                        |
| ----------------------- | ---------------------------------------------------------------------------------- |
| `send_email`            | Send a new email message with attachments, HTML formatting, and recipient options. |
| `create_draft`          | Create an email draft for review before sending.                                   |
| `list_messages`         | List email messages with filtering and pagination support.                         |
| `get_message`           | Get complete details of a specific email message.                                  |
| `forward_message`       | Forward an email to specified recipients.                                          |
| `calendar_create_event` | Create a new calendar event with attendees, location, and scheduling.              |
| `list_events`           | List calendar events with filtering options.                                       |
| `get_event`             | Get details of a specific calendar event.                                          |
| `create_contact`        | Create a new contact in Outlook contacts.                                          |
| `list_contacts`         | List contacts with pagination support.                                             |
| `get_contact`           | Get details of a specific contact.                                                 |

<Info>
  Outlook provides many more functions for email, calendar, contacts, and folder management. Use `get_tools_capabilities` to see the complete list.
</Info>

### Available Triggers

Outlook supports app event triggers:

| Trigger Slug                 | Description                                        |
| ---------------------------- | -------------------------------------------------- |
| `OUTLOOK_NEW_EMAIL`          | Triggered when a new email is received in Outlook. |
| `OUTLOOK_NEW_CALENDAR_EVENT` | Triggered when a new calendar event is created.    |

<Info>
  Use `get_tools_trigger_actions` to discover all available triggers for Outlook.
</Info>

## Zoho Mail

Zoho Mail is a secure, ad-free email hosting platform with collaboration tools, calendar integration, and extensive administrative controls.

### Authentication

Requires authentication with `zoho_mail` integration.

### Available Functions

Zoho Mail provides functions for email management and organization administration:

| Function                                     | Description                                                                           |
| -------------------------------------------- | ------------------------------------------------------------------------------------- |
| `mail_domain_operations`                     | Perform domain operations like verify, set primary domain, hosting, alias management. |
| `mail_groups_delete_group_bulk`              | Bulk delete multiple groups.                                                          |
| `mail_groups_delete_group_by_zgid`           | Delete a specific mail group by its zgid.                                             |
| `mail_organization_get_user_storage_details` | Retrieve storage details for a specific user in the organization.                     |
| `mail_organization_update_spam_process_type` | Update organization spam processing type.                                             |
| `mail_organization_update_user_storage`      | Update user storage allocation.                                                       |
| `mail_update_group_settings`                 | Update group settings and configurations.                                             |

<Info>
  Zoho Mail provides additional functions for email management. Use `get_tools_capabilities` to see the complete list.
</Info>

### Available Triggers

Zoho Mail supports app event triggers:

| Trigger Slug          | Description                                          |
| --------------------- | ---------------------------------------------------- |
| `ZOHO_MAIL_NEW_EMAIL` | Triggered when a new email is received in Zoho Mail. |

<Info>
  Use `get_tools_trigger_actions` to discover all available triggers for Zoho Mail.
</Info>

## Using Email Tools in Workflows

### Example: Automated Email Processing

```
"Read unread emails from Gmail, extract important information, and send summary to Slack"
```

The workflow will:

1. Use Gmail's `fetch_emails` to retrieve unread messages
2. Process email content
3. Send summary to Slack

### Example: Email Trigger Workflow

```
"Start workflow when new email arrives from support@example.com"
```

The workflow will:

1. Use Gmail trigger `GMAIL_NEW_GMAIL_MESSAGE` with filter
2. Process email automatically when received
3. Execute workflow steps

## Best Practices

<AccordionGroup>
  <Accordion title="Email Filtering">
    Use Gmail query syntax for efficient email filtering:

    * `from:user@example.com` - Emails from specific sender
    * `subject:urgent` - Emails with specific subject
    * `after:2024/01/01` - Emails after date
    * `label:important` - Emails with specific label
  </Accordion>

  <Accordion title="Batch Operations">
    Use batch operations for efficiency:

    * `batch_modify_messages` for bulk label updates
    * `batch_delete_messages` for bulk deletions
    * Process up to 1,000 messages at once
  </Accordion>

  <Accordion title="Draft Management">
    Create drafts for review workflows:

    * Use `create_email_draft` for approval workflows
    * Review drafts before sending
    * Use `send_draft` after approval
  </Accordion>
</AccordionGroup>

## Limitations

* **Gmail**: Cannot exceed daily sending quota (typically 500 emails/day for free accounts)
* **Gmail**: Cannot use "me" as recipient\_email (only valid for user\_id parameter)
* **All Tools**: Each tool connects to a single authenticated account per workflow
* **All Tools**: Subject to service rate limits and API quotas

<Warning>
  Each email tool integration connects to a single authenticated account. To use multiple accounts, create separate workflows.
</Warning>
