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

1

Create a Nodemailer account

Create a Nodemailer account 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:

/packages/email/index.ts
export * from './providers/nodemailer';
3

Sending Emails

apps/web/app/contact/actions/contact.tsx
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);