`hono-email/resend` provides `ResendAdapter` for the Resend Email API. The adapter calls Resend directly with `fetch`; the official Resend SDK is not required.

## Example

```tsx
import { Body, Html, Text, sendEmail } from 'hono-email'
import ResendAdapter from 'hono-email/resend'

const receipt = await sendEmail({
  adapter: ResendAdapter({
    apiKey: process.env.RESEND_API_KEY!,
  }),
  from: 'Sender <sender@example.com>',
  to: ['recipient@example.com'],
  subject: 'Welcome',
  jsx: (
    <Html>
      <Body>
        <Text>Hello from Resend.</Text>
      </Body>
    </Html>
  ),
  attachments: [
    {
      filename: 'invoice.txt',
      content: 'Invoice text',
      contentType: 'text/plain',
    },
  ],
})

if (!receipt.successful) {
  console.error(receipt.errorMessages)
}
```

For the full list of configuration options, see the [Resend Options API Reference](/api/adapter-options/#resend-options).

## User-Agent

Resend requires a `User-Agent` header for direct HTTP requests, so `ResendAdapter` sends one by default. You can override it with the `userAgent` option.

## Shared adapter features

Like all provider adapters, Resend supports `to`, `cc`, `bcc`, `replyTo`, custom `headers`, and `attachments`. Inline attachments use `cid` when the provider supports content IDs.

## Options

import { Badge } from '@astrojs/starlight/components'

### `apiKey` <Badge text="Required" variant="caution" size="small" />

**Type:** `string`

Your Resend API key.

### `apiBaseUrl` <Badge text="Optional" variant="note" size="small" />

**Type:** `string` · **Default:** `'https://api.resend.com'`

Override the Resend API base URL.

### `fetch` <Badge text="Optional" variant="note" size="small" />

**Type:** `(input: string, init: RequestInit) => Promise<Response>`

Custom `fetch` implementation. Defaults to `globalThis.fetch`.

### `userAgent` <Badge text="Optional" variant="note" size="small" />

**Type:** `string` · **Default:** `'hono-email'`

`User-Agent` header sent with each request.

### `limits.maxAttachmentSize` <Badge text="Optional" variant="note" size="small" />

**Type:** `number`

Maximum attachment size in bytes.
