# Email & Gmail Integration - Setup Guide - OpenClaw Guide

Connect your inbox to OpenClaw and turn email from a daily chore into something your AI agent handles for you. This guide covers the full integration: connecting Gmail and other providers, what your agent can actually do once connected, how to set up safe workflows, and what to watch out for.

## Your Inbox Is Where Your AI Agent Should Live

Most people spend 2-3 hours a day on email. Most of those emails are routine - status updates, confirmations, newsletters, replies that write themselves. Connecting OpenClaw to your inbox doesn't mean letting an AI take over your communication. It means letting it handle the boring 80% so you can focus on the 20% that actually matters.

## What Your Agent Can Do With Email Access

Once connected, OpenClaw can do everything you'd expect a good assistant to do with your inbox:

### Read & Summarize
- Daily inbox summary
- Group by sender, project, urgency
- Extract action items
- Highlight what needs a response

### Draft & Reply
- Draft responses for your approval
- Match your writing style
- Send approved replies
- Follow up on unanswered threads

### Organize
- Auto-categorize with labels
- Archive newsletters
- Flag urgent threads
- Build searchable memory of important emails

### Automate
- Send confirmations and receipts
- Log expenses from emailed invoices
- Schedule meetings from email threads
- Track project updates from regular senders

## Three Ways to Connect Email to OpenClaw

### Gmail via OAuth (5-10 min)
Easiest for personal Gmail. Sign in with Google, pick scopes, grant access. Quick and secure.

### IMAP/SMTP - Any Provider (10-15 min)
Works with Gmail, Outlook, iCloud, ProtonMail Bridge, Fastmail, and any IMAP-capable inbox. You need an app-specific password from your provider.

### Microsoft 365 / Outlook (5-15 min)
For work email, OAuth is usually smoother but may need IT approval. IMAP works if OAuth is blocked.

## Quick Gmail Setup (OAuth Path)

1. In OpenClaw, open the channels or integrations config
2. Choose Gmail and follow the OAuth flow
3. Pick the scopes you want (read-only is safest to start)
4. Test by asking your agent to summarize today's unread email

For IMAP/SMTP with an app password:

```json
{
  "integrations": {
    "email": {
      "provider": "gmail",
      "imap": {
        "host": "imap.gmail.com",
        "port": 993,
        "user": "you@gmail.com",
        "appPassword": "your-app-password"
      },
      "smtp": {
        "host": "smtp.gmail.com",
        "port": 465
      }
    }
  }
}
```

## Email Workflows Worth Setting Up

Connection is just the start. The real value comes from workflows. Here are the ones that pay off fastest:

### Morning Inbox Brief
Every weekday at 8 AM, your agent reads overnight email, summarizes the urgent ones, archives newsletters, and sends you a clean digest. Saves 30+ minutes a day.

### Draft Replies for Approval
When emails need a response, your agent drafts the reply in your voice and queues it for your approval. You skim, edit if needed, and approve. Way faster than starting from scratch.

### Follow-Up Tracker
Your agent watches sent emails. If a reply doesn't come within X days, it reminds you or drafts a follow-up. No more important threads slipping through.

### Expense Tracking
Receipts come into your inbox. Your agent extracts the amount, vendor, and date, then logs them to a spreadsheet, accounting tool, or sends a summary at month-end.

### Lead Qualification
For businesses: incoming inquiries get parsed for company, role, intent. High-fit leads get tagged or routed to your CRM. Low-fit gets a polite auto-reply.

## Setting It Up Safely

Email is sensitive. Set up access the smart way:

- **Start with read-only** - let your agent observe before letting it act
- **Require manual approval for sending** - especially while you're testing
- **Use app passwords, not main passwords** - they can be revoked individually
- **Limit scopes** - if your agent only needs to read inbox, don't grant send or delete
- **Test on a secondary inbox first** - never start with your primary account
- **Review what gets sent** - check sent items for the first week to confirm behavior
- **Set rate limits** - prevent runaway loops from sending hundreds of messages

## Common Setup Issues

| Problem | Likely Cause | Fix |
|---------|--------------|-----|
| OAuth fails | App not approved, wrong scopes | Re-authorize with correct scopes |
| IMAP connection refused | Wrong port, app password not set | Use port 993 (IMAP) and 465 or 587 (SMTP), generate app password |
| Agent can't see new emails | Polling interval too long | Reduce polling interval in config |
| Replies not sending | SMTP auth failed or rate limited | Check SMTP credentials and provider sending limits |
| Wrong replies sent | Auto-send enabled too early | Switch back to approval-required mode |

## The Easiest Way: Use Ampere.sh

Setting up Gmail OAuth, generating app passwords, configuring IMAP ports, and tweaking SMTP is doable but tedious. Ampere.sh handles email integration in the dashboard - sign in to Gmail, pick scopes, done.

You also get pre-built email workflows (morning brief, draft replies, follow-up tracker) ready to enable, so you skip the prompt engineering too.

[Try Ampere.sh - 7 Days Free](https://www.ampere.sh/setup)

## FAQs

**Can OpenClaw read and reply to my email?**
Yes. Once connected, OpenClaw can read your inbox, draft replies, send messages, search by sender or topic, and act on emails based on rules you set. Most setups use read-only access by default and require manual approval before sending.

**Is it safe to give an AI agent access to my email?**
Yes if you set it up properly. Use read-only OAuth scopes when possible, require manual approval for sending and deleting, use app-specific passwords instead of your main account password, and start with non-sensitive inboxes before connecting your primary email.

**Does OpenClaw work with Gmail, Outlook, and other providers?**
Yes. OpenClaw supports Gmail (via Google API or IMAP), Outlook/Microsoft 365, iCloud Mail, ProtonMail Bridge, and any provider with IMAP/SMTP.

**What can I actually do with email + OpenClaw?**
Daily inbox summaries, auto-categorization, draft replies waiting for your approval, automated follow-ups, expense tracking from receipts, meeting scheduling, lead qualification, and integration with your other workflows like calendar and Slack.

**How long does Gmail integration take to set up?**
Quick OAuth setup takes 5-10 minutes. IMAP setup takes 10-15 minutes (you need an app password from Google). Full workflow configuration (rules, prompts, scheduled summaries) adds another 30-60 minutes.

**Will my agent send emails I didn't approve?**
Only if you let it. Default OpenClaw behavior is approval-required for outbound email. You explicitly turn on auto-send if you want it.

**Can I use this with my work email?**
Depends on your IT policy. Many companies block third-party OAuth apps or require admin approval. For personal Gmail or Workspace accounts you control, it just works.
