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

1. Install

Get the Nodemailer package.

2. Send email using SMTP

When configuring your SMTP integration, you’ll need to use the following credentials:

  • Host:
  • Port: 465
  • Username: resend
  • Password: YOUR_API_KEY

Then use these credentials to create a transport:

import nodemailer from 'nodemailer';

async function main() {
  const transporter = nodemailer.createTransport({
    host: '',
    secure: true,
    port: 465,
    auth: {
      user: 'resend',
      pass: 're_123456789',

  const info = await transporter.sendMail({
    from: '',
    to: '',
    subject: 'Hello World',
    html: '<strong>It works!</strong>',

  console.log('Message sent: %s', info.messageId);


3. Try it yourself

Nodemailer SMTP Example

See the full source code.

Was this page helpful?