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

# Email, inbound replies, and mailboxes

> Configure outbound email with Resend or SMTP, and route candidate replies back to the application record.

Harly can send candidate email through Resend or SMTP and can route inbound
replies back to the correct application through Resend or Postmark webhooks.

## Outbound email

Open **Settings → Email**, choose a provider, configure the sender identity,
and send a test message to a controlled mailbox before inviting any candidates.

### Resend

1. Create a [Resend](https://resend.com) account and verify your sending domain.

2. Create an API key.

3. Open **Settings → Email → Outbound** and choose **Resend**.

4. Paste the API key and set the sender identity:

   ```text theme={null}
   Sender name:  Hiring Team
   Sender email: recruiting@example.com
   ```

5. Select **Send test** and confirm delivery.

### SMTP

Open **Settings → Email → Outbound → SMTP** and configure:

```text theme={null}
Host:     smtp.example.com
Port:     587   (STARTTLS) or 465 (implicit TLS)
Username: recruiting@example.com
Password: <app-password>
From:     recruiting@example.com
```

Use port `465` for implicit TLS or `587` for STARTTLS. Never test with a real
candidate address until the sender domain passes authentication.

## Inbound replies

Inbound replies route candidate responses back to the application thread
automatically. Harly generates a unique `reply+token@domain` address for each
application. Supported providers: **Resend** and **Postmark**.

### Inbound endpoint

The provider webhook must POST to:

```text theme={null}
https://hiring.example.com/api/webhooks/email/{provider}?ws={workspaceId}
```

Where `{provider}` is `resend` or `postmark`, and `{workspaceId}` is the
workspace ID shown in **Settings → Email → Inbound**.

Harly verifies the provider signature using the webhook secret you configure
in the settings screen.

### Setup steps

<Steps>
  <Step title="Configure the receiving domain">
    In **Settings → Email → Inbound**, enter the receiving hostname — only the
    hostname, not a URL:

    ```text theme={null}
    replies.example.com
    ```

    Add the provider's MX records for this domain. For Resend inbound, follow
    [Resend's inbound routing guide](https://resend.com/docs). For Postmark,
    create an inbound server and point its MX records at your domain.
  </Step>

  <Step title="Register the webhook endpoint">
    In the provider dashboard, set the inbound webhook destination to:

    ```text theme={null}
    https://hiring.example.com/api/webhooks/email/resend?ws=ws_YOUR_WORKSPACE_ID
    ```

    Or for Postmark:

    ```text theme={null}
    https://hiring.example.com/api/webhooks/email/postmark?ws=ws_YOUR_WORKSPACE_ID
    ```

    Include the webhook secret shown in Harly's inbound email settings.
  </Step>

  <Step title="Verify">
    Send a message to a test candidate from the Harly inbox. Reply to it from
    an external mailbox. Confirm the reply threads back onto the application
    within one minute.
  </Step>
</Steps>

## Troubleshooting

| Symptom              | Likely cause                                    | Fix                                                            |
| -------------------- | ----------------------------------------------- | -------------------------------------------------------------- |
| No outbound delivery | Invalid sender domain or credentials            | Check email outbox status in operations                        |
| Reply not threaded   | Receiving domain set as URL instead of hostname | Set only `replies.example.com`, not `https://…`                |
| Webhook returns 404  | Wrong workspace ID in query param               | Copy exact workspace ID from Settings → Email → Inbound        |
| Webhook returns 401  | Secret mismatch                                 | Verify the provider has the current secret from Harly settings |
| Duplicate delivery   | At-least-once delivery is expected              | Use provider message IDs to deduplicate at the processor level |

## Next steps

<CardGroup cols={2}>
  <Card title="Inbox and email" icon="inbox" href="/product/inbox-and-email">
    How the workspace inbox and candidate threads work.
  </Card>

  <Card title="Automations" icon="workflow" href="/developers/automations">
    Send messages automatically on stage changes.
  </Card>
</CardGroup>
