Skip to main content
skill CX Codex

email-sending — Claude Code skill: email setup and use

The email-sending skill covers transactional email, provider APIs, SMTP, and reusable templates. Use it when a project needs welcome messages, alerts, or password emails.

MIT 188 installs ★ 50 updated 2026-10-23

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add claude-dev-suite/claude-dev-suite --skill email-sending -a claude-code
Open on GitHub

What email-sending does

The skill shows email delivery in Node.js with Nodemailer, Java with Spring Mail, and Python with aiosmtplib. It also covers SendGrid, Amazon SES, and Resend for transactional delivery, with credentials read from environment variables or provider API keys.

For message layouts, the material uses React Email in React projects and MJML for framework-independent templates. Java examples render a Thymeleaf template before sending. It also discusses plain-text fallbacks, background queues, retry handling, and bounce or complaint webhooks.

A sending domain needs SPF, DKIM, and DMARC records, plus verification with the email provider. Marketing messages should carry a List-Unsubscribe header, and delivery should run through a background queue rather than inside the request handler.

What it helps with

  • connect SMTP delivery in Node.js, Python, or Java
  • send transactional messages through Resend, SendGrid, or Amazon SES
  • build reusable layouts with React Email or MJML
  • keep an HTML message paired with a plain-text version
  • move email delivery into a background job queue

Example prompts for the agent

  • Set up a welcome email with Nodemailer using SMTP_HOST, SMTP_USER, and SMTP_PASS.
  • Create a password-reset layout in emails/welcome.tsx and render it to HTML with React Email.
  • Show how to send an HTML message through Amazon SES and handle bounce events with a webhook.

How to install email-sending

1Skills CLI (Vercel)

npx skills add claude-dev-suite/claude-dev-suite --skill email-sending -a claude-code

2Manually: put the files in place

~/.claude/skills/email-sending/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/email-sending/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about email-sending

How do I install email-sending in Claude Code?

Run npx skills add claude-dev-suite/claude-dev-suite --skill email-sending -a claude-code, then check ~/.claude/skills/email-sending/SKILL.md.

What does email-sending do?

It guides an agent through transactional email setup with SMTP, SendGrid, Amazon SES, or Resend. It also covers React Email and MJML templates.

What is required before sending from a custom domain?

Verify the domain with the email provider and configure SPF, DKIM, and DMARC records. Marketing emails should include a List-Unsubscribe header.

Source text

SKILL.md · MIT
---
name: email-sending
description: |
  Email sending integration. Covers Nodemailer (Node.js), Spring Mail (Java),
  smtplib (Python). Transactional email services: SendGrid, Amazon SES, Resend.
  Template engines: MJML, React Email.

  USE WHEN: user mentions "send email", "nodemailer", "SMTP", "SendGrid",
  "SES", "Resend", "transactional email", "email template", "MJML",
  "React Email", "spring mail"

  DO NOT USE FOR: push notifications - use `push-notifications`;
  SMS - different channel; email parsing/reading
allowed-tools: Read, Grep, Glob, Write, Edit
---
# Email Sending

## Node.js (Nodemailer)

```typescript
import nodemailer from 'nodemailer';

const transporter = nodemailer.createTransport({
  host: process.env.SMTP_HOST,
  port: 587,
  secure: false, // true for 465
  auth: { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS },
});

await transporter.sendMail({
  from: '"My App" <[email protected]>',
  to: '[email protected]',
  subject: 'Welcome!',
  html: '<h1>Welcome</h1><p>Thanks for signing up.</p>',
});
```

## Transactional Email Services

### Resend (recommended for simplicity)
```typescript
import { Resend } from 'resend';

const resend = new Resend(process.env.RESEND_API_KEY);

await resend.emails.send({
  from: 'My App <[email protected]>',
  to: ['[email protected]'],
  subject: 'Welcome!',
  html: '<h1>Welcome</h1>',
});
```

### SendGrid
```typescript
import sgMail from '@sendgrid/mail';
sgMail.setApiKey(process.env.SENDGRID_API_KEY!);

await sgMail.send({
  to: '[email protected]',
  from: '[email protected]',
  templateId: 'd-abc123',        // Dynamic template
  dynamicTemplateData: { name: 'John', link: resetUrl },
});
```

### Amazon SES (via AWS SDK v3)
```typescript
import { SESv2Client, SendEmailCommand } from '@aws-sdk/client-sesv2';

const ses = new SESv2Client({ region: 'us-east-1' });
await ses.send(new SendEmailCommand({
  FromEmailAddress: '[email protected]',
  Destination: { ToAddresses: ['[email protected]'] },
  Content: {
    Simple: {
      Subject: { Data: 'Welcome!' },
      Body: { Html: { Data: htmlContent } },
    },
  },
}));
```

## Email Templates

### React Email (recommended for React projects)
```tsx
// emails/welcome.tsx
import { Html, Head, Body, Container, Text, Button } from '@react-email/components';

export function WelcomeEmail({ name, url }: { name: string; url: string }) {
  return (
    <Html>
      <Head />
      <Body style={{ fontFamily: 'sans-serif' }}>
        <Container>
          <Text>Welcome, {name}!</Text>
          <Button href={url} style={{ background: '#000', color: '#fff', padding: '12px 20px' }}>
            Get Started
          </Button>
        </Container>
      </Body>
    </Html>
  );
}

// Render to HTML string
import { render } from '@react-email/render';
const html = await render(<WelcomeEmail name="John" url="https://app.com" />);
```

### MJML (framework-agnostic)
```typescript
import mjml2html from 'mjml';

const { html } = mjml2html(`
  <mjml>
    <mj-body>
      <mj-section>
        <mj-column>
          <mj-text>Welcome, {{name}}!</mj-text>
          <mj-button href="{{url}}">Get Started</mj-button>
        </mj-column>
      </mj-section>
    </mj-body>
  </mjml>
`);
```

## Python
```python
from email.message import EmailMessage
import aiosmtplib

msg = EmailMessage()
msg["From"] = "[email protected]"
msg["To"] = "[email protected]"
msg["Subject"] = "Welcome!"
msg.set_content("Welcome!", subtype="html")

await aiosmtplib.send(msg, hostname=SMTP_HOST, port=587,
    username=SMTP_USER, password=SMTP_PASS, start_tls=True)
```

## Java (Spring Mail)
```java
@Service
public class EmailService {
    @Autowired private JavaMailSender mailSender;
    @Autowired private TemplateEngine templateEngine; // Thymeleaf

    public void sendWelcome(String to, String name) {
        var ctx = new Context();
        ctx.setVariable("name", name);
        String html = templateEngine.process("welcome", ctx);

        var message = mailSender.createMimeMessage();
        var helper = new MimeMessageHelper(message, true);
        helper.setTo(to);
        helper.setFrom("[email protected]");
        helper.setSubject("Welcome!");
        helper.setText(html, true);
        mailSender.send(message);
    }
}
```

## Anti-Patterns

| Anti-Pattern | Fix |
|--------------|-----|
| Sending email in request handler | Use background job queue (BullMQ, Celery) |
| No retry on transient failure | Retry with exponential backoff (3 attempts) |
| Hardcoded from address | Use env var, match verified domain |
| HTML without plain text fallback | Always include both HTML and text versions |
| No unsubscribe header | Add `List-Unsubscribe` header (required by Gmail/Yahoo) |
| Sending from unverified domain | Set up SPF, DKIM, DMARC records |

## Production Checklist

- [ ] SPF, DKIM, DMARC DNS records configured
- [ ] Domain verified with email provider
- [ ] `List-Unsubscribe` header on marketing emails
- [ ] Bounce and complaint handling (webhook)
- [ ] Email sending via background queue (not in request)
- [ ] Rate limiting to stay within provider limits
- [ ] Plain text fallback for all HTML emails
- [ ] Template preview/testing before deploy

© claude-dev-suite · MIT · claude-dev-suite/claude-dev-suite

Similar skills

All skills for Backend and APIs →

From the same set14

The whole set →
dotnet-security dotnet-security hardens ASP.NET Core apps with security middleware, safe database queries, and automated NuGet dependency auditing. CX Codex +1 358installs token-optimization token-optimization teaches agents to minimize token usage when calling MCP tools and external APIs. Keeps context clean by enforcing limits and compact responses. CX Codex +1 354installs owasp-top-10 This skill guides OWASP Top 10:2025 security reviews, covering access control, injection, cryptography, supply-chain risks, and exception handling. CX Codex +1 330installs webrtc WebRTC skill for P2P communication: video calls, screen sharing, data channels. Writes signaling logic, configures ICE/STUN/TURN, integrates SFU like LiveKit. CX Codex +1 217installs cron-scheduling The cron-scheduling skill covers recurring jobs with cron, node-cron, Spring @Scheduled, and APScheduler. Use it when a project needs timed or periodic execution. CX Codex +1 162installs iec61131 A reference for IEC 61131-3 languages, PLC data types, and program structure. Use it when comparing control-language options or checking project exchange formats. CX Codex +1 154installs plsql A skill for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode: Oracle PL/SQL — procedures, functions, packages, triggers, cursors, collections and exception handling. CX Codex +1 106installs socket-io Guides your coding assistant through Socket.IO real-time features: namespaces, rooms, middleware auth, and Redis scaling. CX Codex +1 106installs

Project sponsors

Companies that keep this analytics open