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

# Nodemailer

> Learn how to use Nodemailer for sending emails.

To use Nodemailer with ShipThing, make sure you have an SMTP server available, that you can send mails from.

**1. Create a Nodemailer account**

[Create a Nodemailer account](https://resend.com/) and grab your API key.

**2. Add environment variables**

Add the `NODEMAILER_HOST` , `NODEMAILER_USER` , `NODEMAILER_USER` and `NODEMAILER_PASS` environment variables to your .env.local file and your deployment environment:

Then, make sure to activate Nodemailer:

```ts /packages/email/index.ts theme={"system"}
export * from './providers/nodemailer';
```

**3. Sending Emails**

```tsx apps/web/app/contact/actions/contact.tsx theme={"system"}
import { nodemailerTransporter } from '@repo/email';
import { ContactTemplate } from '@repo/email/emails/contact';
import { render } from "@react-email/components";

const emailHtml = await render(<ContactTemplate name={name} email={email} message={message} />);

const options = {
from: 'you@example.com',
to: 'user@gmail.com',
subject: 'hello world',
html: emailHtml,
};

await nodemailerTransporter.sendMail(options);
```


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