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

# Mail logs

# Mail logs

**Mail logs** are the source of truth for every email Mailofly attempts to deliver — recipient, subject, status, timestamps, and error details.

**In the app:** [Emails](https://www.mailofly.com/user/emails)

***

## What's logged

Each row represents one recipient in one send attempt:

| Field             | Description                            |
| ----------------- | -------------------------------------- |
| `to_email`        | Recipient address                      |
| `subject`         | Rendered subject (merge tags resolved) |
| `body_html`       | Rendered HTML body                     |
| `status`          | Current delivery state                 |
| `from_email`      | Sender address used                    |
| `account_id`      | Which sending account delivered        |
| `campaign_id`     | Campaign (null for Compose sends)      |
| `campaign_run_id` | Which campaign run                     |
| `contact_id`      | Linked contact record                  |
| `sent_at`         | When delivery completed                |
| `error`           | Failure message from SMTP/provider     |
| `smtp_message_id` | Provider message ID                    |

***

## Status lifecycle

```
pending → sending → sent
                 ↘ failed
                 ↘ deferred (quota — retries tomorrow)
                 ↘ halted
```

| Status     | Meaning                             | Action                                                |
| ---------- | ----------------------------------- | ----------------------------------------------------- |
| `pending`  | Queued, not yet picked up           | Wait — refresh the page                               |
| `sending`  | Currently being delivered           | Wait                                                  |
| `sent`     | Handed off successfully to provider | ✓ Done                                                |
| `failed`   | SMTP or provider rejected           | Read `error` field — fix credentials, DNS, or content |
| `deferred` | Daily account quota hit             | Sends tomorrow automatically                          |
| `halted`   | Manually stopped or system halt     | Investigate campaign state                            |

***

## Debug a failed send

1. Open **[Emails](https://www.mailofly.com/user/emails)**
2. Filter by **status: failed** or search the recipient email
3. Click the row to open the detail panel
4. Read the **error** message — common causes:

| Error pattern         | Likely fix                                     |
| --------------------- | ---------------------------------------------- |
| Authentication failed | Check SMTP username/password or re-auth Google |
| SPF/DKIM fail         | Verify [DNS records](domains.md)               |
| Rate limit / quota    | Lower volume or add accounts                   |
| Invalid recipient     | Check email format / suppression               |

***

## Filters

| Filter       | Use case                          |
| ------------ | --------------------------------- |
| Search       | Find a specific email address     |
| Campaign     | All sends for one blast           |
| Account      | Debug one sending identity        |
| Status       | Isolate failures or deferred rows |
| Campaign run | Compare runs of the same campaign |

***

## API

```bash theme={null}
curl -sS "https://api.mailofly.com/v1/mail-logs?status=failed&page=1&page_size=50" \
  -H "Authorization: Bearer mf_live_…" \
  -H "Accept: application/json"
```

Query parameters: `page`, `page_size` (max 100), `campaign_id`, `account_id`, `status`, `campaign_run_id`.

Full reference: [API: Mail logs](https://docs.mailofly.com/api/mail-logs)

***

## Retention

Log storage depends on your plan:

| Plan  | Stored logs  | Retention |
| ----- | ------------ | --------- |
| Free  | 5,000 rows   | 3 days    |
| Basic | 25,000 rows  | 14 days   |
| Scale | 500,000 rows | 30 days   |

Older logs are pruned automatically. Export via API if you need long-term archives.

***

## Related

* [Campaigns](campaigns.md) — run history
* [Sending accounts](accounts.md) — quota and deferral
* [Integrations → Webhooks](https://docs.mailofly.com/integrations/webhooks) — signed outbound event notifications


## Related topics

- [Dart](/getting-started/dart.md)
- [Go](/getting-started/go.md)
- [Nodejs](/getting-started/nodejs.md)
- [Php](/getting-started/php.md)
- [Python](/getting-started/python.md)
