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

# Send Email from Node.js with Nodemailer and turboSMTP

> Use the built-in TurboSMTP and TurboSMTP-EU service presets in Nodemailer to send email from Node.js through the turboSMTP SMTP relay in minutes.

**Status: Available in Nodemailer 9.0.4 and later.** Nodemailer includes turboSMTP in its list of [well-known services](https://nodemailer.com/smtp/well-known-services). Set `service` to `TurboSMTP` or `TurboSMTP-EU` and Nodemailer fills in the host, port, and TLS settings for you.

| Service ID | SMTP host | Port | Secure |
| - | - | - | - |
| `TurboSMTP` | `pro.turbo-smtp.com` | 465 | yes |
| `TurboSMTP-EU` | `pro.eu.turbo-smtp.com` | 465 | yes |

## Install Nodemailer

```bash npm theme={"system"}
npm install nodemailer
```

```bash yarn theme={"system"}
yarn add nodemailer
```

```bash pnpm theme={"system"}
pnpm add nodemailer
```

## Send the first message

Authenticate with your [Consumer Key](/docs/get-started/api-keys.md) as the username and your Consumer Secret as the password, as on any [SMTP connection](/docs/get-started/smtp-configuration.md).

Enable **SMTP Sending** on the key and check any IP restrictions before sending.

```javascript send.js theme={"system"}
import nodemailer from "nodemailer";

const transporter = nodemailer.createTransport({
  service: "TurboSMTP", // or "TurboSMTP-EU" for European servers
  auth: {
    user: process.env.TURBOSMTP_CONSUMER_KEY,
    pass: process.env.TURBOSMTP_CONSUMER_SECRET,
  },
});

await transporter.sendMail({
  from: "noreply@your-domain.example",
  to: "developer@example.com",
  subject: "Hello from Node.js",
  text: "The turboSMTP relay is working.",
});
```

> [!TIP]
>
> The presets use implicit TLS on port 465. For manual configuration, both hosts also support implicit TLS on 25025 and STARTTLS on 587 or 2525; port 25 is available. See [SMTP Setup](/docs/get-started/smtp-configuration.md).

## HTTP API transport

> [!NOTE]
>
> To send through HTTPS, call the [Email API](/docs/sending/email-api.md) directly.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.