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

# Send emails with Node.js

> Learn how to send your first email using the Emailr Node.js SDK.

## Prerequisites

To get the most out of this guide, you'll need to:

* [Create an API key](https://app.emailr.dev/dashboard/keys)
* [Verify your domain](https://app.emailr.dev/dashboard/domains)

## 1. Install

Get the Emailr Node.js SDK.

<CodeGroup>
  ```bash npm theme={null} theme={null}
  npm install emailr
  ```

  ```bash yarn theme={null} theme={null}
  yarn add emailr
  ```

  ```bash pnpm theme={null} theme={null}
  pnpm add emailr
  ```

  ```bash bun theme={null} theme={null}
  bun add emailr
  ```
</CodeGroup>

## 2. Send email using HTML

The easiest way to send an email is by using the `html` parameter.

```js server.ts theme={null} theme={null}
import { Emailr } from 'emailr';

const emailr = new Emailr('em_xxxxxxxxx');

(async function () {
  const { data, error } = await emailr.emails.send({
    from: 'Acme <onboarding@emailr.dev>',
    to: ['delivered@emailr.dev'],
    subject: 'Hello World',
    html: '<strong>It works!</strong>',
  });

  if (error) {
    return console.error({ error });
  }

  console.log({ data });
})();
```

## 3. Try it yourself

<Card title="Node.js Example" icon="arrow-up-right-from-square" href="https://github.com/emailr/emailr-node-example">
  See the full source code.
</Card>
