---
title: Agent Email
description: Send and receive email from your agent's dedicated email address
---

# Agent Email

Every Agnic agent gets a dedicated email address (`agent-{id}@agent.agnic.ai`) for sending emails, receiving replies, and signing up for services.

---

## Commands

### Check Email Address

```bash
npx agnic@latest email address [--json]
```

### Set Up Email Alias

```bash
npx agnic@latest email setup [--display-name <name>] [--json]
```

| Option | Description |
|--------|-------------|
| `--display-name <name>` | Display name for outgoing emails |
| `--json` | Output as JSON |

### Check Inbox

```bash
npx agnic@latest email inbox [--limit <n>] [--json]
```

| Option | Description |
|--------|-------------|
| `--limit <n>` | Max messages to show (default: 20, max: 100) |
| `--json` | Output as JSON |

### Send Email

```bash
npx agnic@latest email send --to <address> --subject <subject> --body <body> [--json]
```

| Option | Description |
|--------|-------------|
| `--to <address>` | Recipient email address (required) |
| `--subject <subject>` | Email subject line (required) |
| `--body <body>` | Email body text (required) |
| `--json` | Output as JSON |

### Reply to Message

```bash
npx agnic@latest email reply --message-id <id> --body <body> [--json]
```

| Option | Description |
|--------|-------------|
| `--message-id <id>` | ID of the message to reply to (required) |
| `--body <body>` | Reply body text (required) |
| `--json` | Output as JSON |

---

## Examples

```bash
# Set up your agent's email
npx agnic@latest email setup --display-name "My Research Agent"

# Send an email
npx agnic@latest email send \
  --to user@example.com \
  --subject "Research Results" \
  --body "Here are the findings from my analysis..."

# Check inbox for replies
npx agnic@latest email inbox --json

# Reply to a message
npx agnic@latest email reply \
  --message-id aem_1775222237594_v4gwcj \
  --body "Thank you for your feedback"
```

---

## How It Works

1. **Auto-created on onboarding** — when your agent is registered, an email alias is created automatically
2. **Unique address** — each agent gets `agent-{id}@agent.agnic.ai`
3. **Full inbox** — inbound emails are stored and accessible via CLI, MCP, or API
4. **30-day retention** — messages older than 30 days are automatically cleaned up

---

## Prerequisites

- Must be authenticated (`npx agnic@latest auth login`)
- Agent must be onboarded (happens automatically on first API key creation)

---

## Error Handling

| Error | Solution |
|-------|----------|
| "Not authenticated" | Run `npx agnic@latest auth login` |
| "No email alias found" | Run `npx agnic@latest email setup` |
| "No active agent found" | Complete onboarding at [app.agnic.ai](https://app.agnic.ai) |
| "Email sending not configured" | Contact support — Resend provider may be unavailable |

---

## Next Steps

<Cards>
  <Card title="Agent Identity" href="/docs/agentic-wallet/skills/get-agent-identity">
    Check your on-chain ERC-8004 identity
  </Card>
  <Card title="Pay for Service" href="/docs/agentic-wallet/skills/pay-for-service">
    Make paid x402 API requests
  </Card>
</Cards>
