Skip to content

documenso/nodemailer-resend

Repository files navigation

Nodemailer Resend

Transport for sending email via the Resend SDK

NPM Version GitHub Repo stars GitHub

Getting Started!

Install the package

npm install @documenso/nodemailer-resend

Usage

Create Nodemailer Transport

import { ResendTransport } from '@documenso/nodemailer-resend';
import { createTransport } from 'nodemailer';

const mailer = createTransport(
  createTransport(
    ResendTransport.makeTransport({
      apiKey: process.env.NEXT_PRIVATE_RESEND_API_KEY || '',
    }),
  ),
);

Send an Email

mailer.sendMail({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Hello from Resend!',
  html: '<h1>Hello world!</h1>',
});