> ## 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.

# Managing Identities

> How to connect, configure, test, and manage Google and custom SMTP identities in Mailofly.

# Managing Identities

The **Identities** dashboard allows you to manage all connected sending mailboxes, check daily sending capacity, test connection health, and grab public account keys for API sends.

Navigate to **[Identities](https://www.mailofly.com/user/accounts)** in your dashboard to get started.

***

## Connecting an Identity

### 1. Google Account (Gmail & Google Workspace)

Connecting a Google identity takes less than 30 seconds using Google's secure OAuth 2.0 flow:

<Steps>
  <Step title="Click Add Identity">
    In the Identities screen, click the **Add Identity** button in the top right.
  </Step>

  <Step title="Authorize Google Access">
    Select **Connect with Google**. You will be redirected to Google's consent screen.
  </Step>

  <Step title="Grant Sending Permissions">
    Select the Google or Google Workspace account you wish to send from and approve the requested email sending permissions.
  </Step>

  <Step title="Confirmation & Redirect">
    Upon authorization, you will be redirected back to Mailofly with your new Google identity listed as active.
  </Step>
</Steps>

<Note>
  Mailofly stores the OAuth refresh token securely in encrypted storage. You can revoke access at any time from your Google Account Security settings or directly in Mailofly.
</Note>

***

### 2. Custom SMTP Account

You can connect any standard SMTP relay server (e.g., Mailgun, SendGrid, Amazon SES, Postmark, cPanel, or internal corporate mail servers):

<Steps>
  <Step title="Enter Server Details">
    Provide your SMTP connection credentials:

    * **Identity Name**: A human-friendly display name (e.g. `Corporate Postfix Relay`).
    * **SMTP Host**: The hostname of your mail server (e.g. `smtp.example.com`).
    * **SMTP Port**: Typically `587` (STARTTLS) or `465` (SSL/TLS).
    * **Username**: Your SMTP username or API key.
    * **Password**: Your SMTP password or API token.
    * **Custom From Address**: The default email address associated with this identity.
  </Step>

  <Step title="Test Connection">
    Mailofly performs an automated TLS handshake to ensure credentials and network connectivity succeed before saving.
  </Step>
</Steps>

***

## Account Keys (`acc_...`)

Every identity generated in Mailofly is assigned a unique, immutable **Account Key** prefixed with `acc_`:

```text theme={null}
acc_3a8f9c12b0e451a9
```

### Why use an Account Key?

While you can simply use the identity's email address as the `from` field in API calls, the account key provides two distinct benefits:

1. **Explicit Routing**: If you have multiple accounts connected with the same domain or alias, specifying `account_key` removes any ambiguity.
2. **Key-based Workflows**: Useful when configuring automated campaign schedulers or system integrations where sending addresses may vary dynamically.

### Passing the Account Key in API Requests

```bash cURL theme={null}
curl -X POST https://api.mailofly.com/api/v1/emails \
  -H "Authorization: Bearer mf_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "account_key": "acc_3a8f9c12b0e451a9",
    "from": "Alex <alex.developer@gmail.com>",
    "to": ["user@example.com"],
    "subject": "Testing with Account Key",
    "html": "<p>Explicitly routed using account_key!</p>"
  }'
```

***

## Daily Limits & Capacity Meter

Each identity row displays a **Capacity Meter** indicating daily volume usage:

* **Gmail Personal**: Default limit of 500 emails/day.
* **Google Workspace**: Default limit of 500–2,000 emails/day depending on Google Workspace tier.
* **Custom SMTP**: Configurable in identity settings (default 500 emails/day).

### How Capacity Works

1. **Daily Reset**: Sending quotas reset automatically at **00:00 UTC** every day.
2. **Visual Meter**:
   * **Green**: \< 50% capacity used.
   * **Yellow**: 50%–85% capacity used.
   * **Red**: > 85% capacity used or at limit.
3. **Over-Quota Handling**: If an outbound send exceeds your remaining daily capacity, the email is not dropped; instead, it is marked as `deferred` and held until your quota resets.

***

## Testing & Troubleshooting

* **Connection Test**: Click the actions menu (`...`) on any identity row and select **Test Connection** to verify that credentials and OAuth tokens are still valid.
* **Deactivating an Identity**: Toggle the **Active** switch off to prevent new emails from dispatching through the identity without permanently deleting it.
* **Token Expiry**: If a Google OAuth token expires or permissions are revoked, Mailofly will notify you on the dashboard with a prompt to re-authenticate.


## Related topics

- [Send without a domain (Identities)](/getting-started/identities.md)
- [Managing Emails](/receiving/managing-emails.md)
- [Managing the Suppression List](/guides/deliverability/managing-the-suppression-list.md)
- [How Identities Send](/identities/how-it-sends.md)
- [Introduction](/identities/introduction.md)
