Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aidotnet avatar

Nodemailer

  • 75 installs
  • 84 repo stars
  • Updated January 28, 2026
  • aidotnet/moyucode

nodemailer is a Claude Code skill for sending emails from Node.js with SMTP, OAuth2, attachments, and HTML templates.

About

nodemailer is a Claude Code skill that shows how to send email from a Node.js application using the Nodemailer module. It covers SMTP and Gmail OAuth2 auth, HTML template emails, attachments, and a rate-limited email queue. A developer uses it to add transactional email to a backend.

  • Sends email from Node.js via SMTP or Gmail OAuth2
  • Supports HTML templates and attachments
  • Includes a rate-limited email queue pattern

Nodemailer by the numbers

  • 75 all-time installs (skills.sh)
  • Ranked #3,062 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

nodemailer capabilities & compatibility

Free library; requires SMTP credentials or Gmail OAuth2 client/refresh tokens via env vars.

Capabilities
email sending · smtp · oauth2 email · email templates
Works with
gmail
Use cases
email · api development
Pricing
Bring your own API key
From the docs

What nodemailer says it does

Send emails from Node.js with SMTP, OAuth2, attachments, and HTML templates.
SKILL.md
npm install nodemailer
SKILL.md
npx skills add https://github.com/aidotnet/moyucode --skill nodemailer

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs75
repo stars84
Last updatedJanuary 28, 2026
Repositoryaidotnet/moyucode

What it does

Send transactional email from Node.js via SMTP or OAuth2 with HTML and attachments.

When should I use this skill?

A developer needs to send email from a Node.js backend.

What you get

The developer sends templated, attachment-carrying email from Node.js.

By the numbers

  • 5 patterns: basic email, HTML template, attachments, OAuth2, rate-limited queue

Files

SKILL.mdMarkdownGitHub ↗

Nodemailer Tool

Description

Send emails from Node.js with SMTP, OAuth2, attachments, and HTML templates.

Source

Installation

npm install nodemailer

Usage Examples

Basic Email

import nodemailer from 'nodemailer';

const transporter = nodemailer.createTransport({
  host: 'smtp.gmail.com',
  port: 587,
  secure: false,
  auth: {
    user: process.env.EMAIL_USER,
    pass: process.env.EMAIL_PASS,
  },
});

async function sendEmail() {
  const info = await transporter.sendMail({
    from: '"My App" <noreply@myapp.com>',
    to: 'user@example.com',
    subject: 'Welcome to My App',
    text: 'Hello, welcome to our platform!',
    html: '<h1>Hello</h1><p>Welcome to our platform!</p>',
  });
  
  console.log('Message sent:', info.messageId);
}

HTML Email with Template

async function sendWelcomeEmail(user: { name: string; email: string }) {
  const html = `
    <!DOCTYPE html>
    <html>
      <head>
        <style>
          .container { max-width: 600px; margin: 0 auto; font-family: Arial; }
          .header { background: #4F46E5; color: white; padding: 20px; }
          .content { padding: 20px; }
          .button { background: #4F46E5; color: white; padding: 12px 24px; 
                    text-decoration: none; border-radius: 4px; }
        </style>
      </head>
      <body>
        <div class="container">
          <div class="header">
            <h1>Welcome, ${user.name}!</h1>
          </div>
          <div class="content">
            <p>Thank you for joining our platform.</p>
            <a href="https://myapp.com/dashboard" class="button">Get Started</a>
          </div>
        </div>
      </body>
    </html>
  `;
  
  await transporter.sendMail({
    from: '"My App" <noreply@myapp.com>',
    to: user.email,
    subject: `Welcome, ${user.name}!`,
    html,
  });
}

Email with Attachments

async function sendEmailWithAttachment() {
  await transporter.sendMail({
    from: '"Reports" <reports@myapp.com>',
    to: 'manager@company.com',
    subject: 'Monthly Report',
    text: 'Please find the monthly report attached.',
    attachments: [
      {
        filename: 'report.pdf',
        path: './reports/monthly-report.pdf',
      },
      {
        filename: 'data.xlsx',
        content: Buffer.from('...'), // Buffer content
      },
      {
        filename: 'logo.png',
        path: './assets/logo.png',
        cid: 'logo@myapp', // For embedding in HTML
      },
    ],
    html: '<img src="cid:logo@myapp" /><p>See attached report.</p>',
  });
}

OAuth2 Authentication (Gmail)

const transporter = nodemailer.createTransport({
  service: 'gmail',
  auth: {
    type: 'OAuth2',
    user: process.env.GMAIL_USER,
    clientId: process.env.GOOGLE_CLIENT_ID,
    clientSecret: process.env.GOOGLE_CLIENT_SECRET,
    refreshToken: process.env.GOOGLE_REFRESH_TOKEN,
  },
});

Email Queue with Rate Limiting

class EmailQueue {
  private queue: Array<() => Promise<void>> = [];
  private processing = false;
  
  async add(emailFn: () => Promise<void>) {
    this.queue.push(emailFn);
    this.process();
  }
  
  private async process() {
    if (this.processing) return;
    this.processing = true;
    
    while (this.queue.length > 0) {
      const emailFn = this.queue.shift()!;
      await emailFn();
      await new Promise(r => setTimeout(r, 1000)); // Rate limit
    }
    
    this.processing = false;
  }
}

Tags

email, smtp, notification, communication, automation

Compatibility

  • Codex: ✅
  • Claude Code: ✅

Related skills

Backend & APIsbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.