> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.runtype.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.runtype.com/_mcp/server.

# Resend (email sending)

Runtype sends email through Resend. The **Send Email** Flow step and the **Send Email** built-in tool (`builtin:send_email`) both use it. You can send from a platform-managed address without a Resend account, or connect your own Resend account to send from your own domain.

## Choose a sender

The `from` value decides which sender and which Resend account a message uses:

| `from` value                        | Sends as                                                                            | Resend account               |
| ----------------------------------- | ----------------------------------------------------------------------------------- | ---------------------------- |
| Blank                               | `FLOW_ID@runtype.email` from a Flow step, or `AGENT_ID@runtype.email` from an Agent | The Runtype platform account |
| An address on a domain that you own | The address that you enter, such as `team@example.com`                              | Your Resend account          |

In these addresses, `FLOW_ID` is the ID of the Flow that sends the email, and `AGENT_ID` is the ID of the Agent that calls the tool. A Flow that you send inline in a dispatch request, without saving it, sends as `virtual@runtype.email`. The only exception is a request whose `flow.id` names a Flow in your account, which sends as that Flow's ID.

The platform-managed sender needs no setup. Runtype tracks each platform-managed send as platform-key spend. For how platform-key spend is billed and limited, see [Platform keys vs. BYOK](/user-guide/getting-started/platform-keys-vs-byok).

A custom sender can't use the `runtype.email` domain. Messages from a blank `from` always go through the Runtype platform account, even after you connect your own Resend key.

## Connect your Resend account

Before you begin, make sure that you have the following:

* A Resend account with a domain that Resend has verified. Resend rejects messages from an unverified domain.
* A Resend API key.
* A Runtype plan that includes BYOK, which is the Team plan or higher.

To connect your Resend account, follow these steps:

1. In Runtype, go to **Settings > Integrations**.
2. Find the **Email** section.
3. In **Resend API Key**, enter your key.
4. Click **Save Key**.

After you save, the **Email** section confirms that your key is configured. To disconnect your account, click **Remove Key**. After you remove the key, only the platform-managed sender works.

## Send from your domain in a Flow

To send from your own address in a Flow, follow these steps:

1. Add a **Send Email** step.
2. In **from**, enter an address on your verified domain. You can use variables, for example `{{sender}}`.
3. In **Send email to**, **subject**, and **HTML**, enter the recipients, the subject, and the body.

The **from** field is read-only until you connect a Resend key. When it's blank, the step shows the default sender `{{_flow.id}}@runtype.email`.

In a Flow definition, set `from` in the step's `config`:

**`Send Email step with a custom sender`**

```json title="Send Email step with a custom sender"
{
  "type": "send-email",
  "name": "Send digest",
  "config": {
    "from": "team@example.com",
    "to": "{{customerEmail}}",
    "subject": "Your weekly digest",
    "html": "<p>{{summary}}</p>",
    "outputVariable": "digestEmail"
  }
}
```

After a successful send, the step writes an object with `id`, `from`, `to`, `subject`, `status`, and `timestamp` to its output variable. The `id` is the Resend email ID.

By default, a failed Send Email step doesn't stop the Flow. It writes `{ "status": "failed", "error": "..." }`, or the step's default value, to the output variable. To stop the Flow instead, change the step's error handling. For details, see [Flow step types overview](/user-guide/flows/flow-step-types-overview#when-a-step-fails).

## Send from your domain in an Agent

To let an Agent send email, add **Send Email** (`builtin:send_email`) to the Agent's tools. The model sets the `from` parameter. When the model leaves `from` blank, the tool uses the platform-managed sender. For the full parameter list, see [Send Email](/user-guide/tools/built-in-tools#send-email).

To send from your own domain every time, tell the Agent which address to use in its instructions. For example: `Send all email from support@example.com.`

The tool sends real email. To pause the Agent until a person approves each send, add `builtin:send_email` to the Agent's approval list. For the setting, see [Require approval for tools that act for you](/user-guide/tools/built-in-tools#require-approval-for-tools-that-act-for-you).

## Reply from an Email Surface through Resend

An Email Surface can send its replies through your Resend account instead of the Runtype platform account. This setting uses its own key, separate from the key in **Settings > Integrations**.

To set it up, follow these steps:

1. Open the Email Surface's settings, and then open the **Inbound** tab.
2. In **Email Provider**, select **Resend**.
3. In **API Key**, enter a Resend API key. To receive email through Resend, the key needs the **Full access** permission.
4. In **From Address**, enter an address on your verified domain.
5. Optional: In **From Name**, enter the sender name that recipients see, such as `Support Team`.

To go back to the platform account, select **Runtype Email** in **Email Provider**.

## Troubleshooting

The following table lists common errors. In the table, `STATUS` is the HTTP status code that Resend returns. A Flow step adds the prefix `Failed to send email:` when its error handling stops the Flow. The Agent tool adds the prefix `send_email failed:`.

| Error                                                                  | Cause                                                                                              | Fix                                                                                             |
| ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| `A custom email provider key is required for custom sender addresses`  | The `from` value is a custom address, and no Resend key is connected.                              | Connect your Resend key in **Settings > Integrations**, or leave `from` blank.                  |
| `Custom sender addresses cannot use the managed @runtype.email domain` | The `from` value is a custom address on `runtype.email`.                                           | Use an address on your own domain, or leave `from` blank.                                       |
| `Platform key spend credit is exhausted`                               | `from` is blank, and your platform-key credit balance is used up.                                  | Set a default payment method in **Billing**, or send from your own domain with your Resend key. |
| `Resend API error: STATUS - ...`                                       | Resend rejected the request. For example, the sender domain isn't verified, or the key is invalid. | Verify the domain and check the key in the Resend dashboard.                                    |
| **Failed to save Resend API key** when you click **Save Key**          | Your plan doesn't include BYOK.                                                                    | Upgrade to the Team plan or higher, or use the platform-managed sender.                         |

## Next steps

Continue with these pages:

* [Built-in tools](/user-guide/tools/built-in-tools#send-email): see every parameter of the Send Email tool.
* [Flow step types overview](/user-guide/flows/flow-step-types-overview#send-email): learn how the Send Email step fits with other steps.
* [Flow variables and templates](/user-guide/flows/flow-variables-and-templates): build recipients, subjects, and bodies from variables.
* [Platform keys vs. BYOK](/user-guide/getting-started/platform-keys-vs-byok): compare platform keys with your own provider keys.