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

# Email (Gmail)

> Give Fliiq its own Gmail so people can email it directly

<Note>
  **This page is about Fliiq's own email channel** — giving Fliiq its own Gmail address so people (including you) can talk to it by email.

  Looking for Fliiq to manage **your** Gmail inbox and calendar? See [Google Integration](/guides/google).
</Note>

Fliiq gets its own Gmail account. You give Fliiq a dedicated email address (e.g., `my-fliiq@gmail.com`), and then you interact with Fliiq the way you'd email any person: you send to Fliiq's email, and Fliiq replies from its own address.

This is one of Fliiq's **channels** — a way to talk to Fliiq alongside [SMS](/channels/sms) and [Telegram](/channels/telegram). [Telegram](/channels/telegram) is the fastest to set up if you want to start there.

## Setup

There are two ways to configure Fliiq's email channel:

### Option A: App Password (simplest)

1. **Create or choose a Gmail** for Fliiq (e.g., `my-fliiq@gmail.com`)
2. **Enable 2-Step Verification** on that Google Account
3. **Create an App Password** at [myaccount.google.com/apppasswords](https://myaccount.google.com/apppasswords)
4. **Add to `.env`:**

```bash .env theme={null}
FLIIQ_GMAIL_ADDRESS=my-fliiq@gmail.com
FLIIQ_GMAIL_APP_PASSWORD=xxxx-xxxx-xxxx-xxxx
```

### Option B: OAuth

If you've already set up [Google OAuth](/guides/google) for managing your own accounts, you can also authorize Fliiq's bot email via OAuth:

```bash theme={null}
fliiq google auth    # Sign in with Fliiq's Gmail account
```

Then set the bot email in `.env` so Fliiq knows which account is "its own":

```bash .env theme={null}
FLIIQ_GMAIL_ADDRESS=my-fliiq@gmail.com
```

OAuth is more secure (no app password stored) and uses the same token infrastructure as your personal accounts.

## Skills

### send\_email

Send an email from Fliiq's Gmail.

```
"Send an email to alice@example.com about the meeting tomorrow"
```

### receive\_emails

Fetch emails from Fliiq's inbox. Returns newest first with read/unread status.

```
"Check your inbox for new emails"
"Show me unread emails in your inbox"
```

Supports a `filter` parameter: `all` (default), `unread`, `read`.

### mark\_email\_read

Mark a specific email as read by message ID.

### archive\_email

Move an email from Inbox to All Mail (Gmail archive).

### delete\_email

Move an email to Trash.

## Persistent Session Store

The email listener maintains a persistent session store — per-sender conversation history stored in `.fliiq/email_sessions/`. Context survives daemon restarts, so Fliiq remembers the conversation thread with each sender across multiple emails and restarts. Outbound replies sent via `send_email` are also logged to the session store, keeping the full exchange intact.

## Usage in Jobs

Email skills work in scheduled jobs. For example, Fliiq can check its own inbox periodically and respond to messages:

```yaml theme={null}
name: fliiq-inbox-responder
trigger:
  type: cron
  schedule: "*/15 * * * *"   # Every 15 minutes
prompt: |
  Check your inbox for unread emails.
  Read each one and respond helpfully.
  Mark processed emails as read.
skills:
  - receive_emails
  - send_email
  - mark_email_read
  - memory_read
  - memory_write
enabled: true
```

## Fliiq's Email vs Your Email

Remember: this channel is Fliiq's own inbox. When Fliiq checks "its" email, it's looking at the `FLIIQ_GMAIL_ADDRESS` account.

If you want Fliiq to manage **your** personal or work Gmail — reading your emails, responding on your behalf, cleaning your inbox — see [Google Integration](/guides/google). That's a different setup using OAuth to authorize Fliiq on your accounts.
