
- Installs
- 95
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/aidotnet/moyucode --skill nodemailer- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads nodemailer automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Nodemailer Tool
Description
Send emails from Node.js with SMTP, OAuth2, attachments, and HTML templates.
Source
- Repository: nodemailer/nodemailer
- License: MIT
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: ✅
FAQ
What does the nodemailer skill do?
从Node.js应用发送邮件。最流行的邮件发送模块,支持SMTP、OAuth2、附件和HTML模板。
How do I install nodemailer?
Run npx skills add https://github.com/aidotnet/moyucode --skill nodemailer in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/nodemailer/ (personal) or .claude/skills/nodemailer/ (project).
Which AI agents can use nodemailer?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is nodemailer safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains nodemailer?
It is published by aidotnet in aidotnet/moyucode. It has 95 recorded installs.
More from aidotnet/moyucode
exceljs
aidotnet/moyucode
在Node.js中读取、操作和写入Excel电子表格(XLSX)。完全支持样式、公式、图表和大文件流式处理。
excel-handler
aidotnet/moyucode
读取、写入和操作Excel文件(.xlsx、.xls)。创建电子表格、读取数据并导出为各种格式。
Popular frontend & design skills
setup-matt-pocock-skills
mattpocock/skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
frontend-design
anthropics/skills
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
hyperframes-animation
heygen-com/hyperframes
All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition's choreography (animation map) and 24 named text-animation effects. HyperFrames-native: single paused timeline, seek-safe, deterministic.
prototype
mattpocock/skills
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
hyperframes-core
heygen-com/hyperframes
The HyperFrames composition contract — build one renderable project. Use for composition structure, the data- timing attributes, class="clip", tracks, sub-compositions, variables, framework-owned media playback, deterministic-render rules, and validation. Read before writing composition HTML.
vercel-react-best-practices
vercel-labs/agent-skills
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.