home / skills / aidotnet / moyucode / email-sender
This skill sends emails via SMTP with HTML content, attachments, and multiple recipients, leveraging nodemailer for reliable notifications.
npx playbooks add skill aidotnet/moyucode --skill email-senderReview the files below or copy the command above to add this skill to your agents.
---
name: email-sender
description: 使用SMTP发送带附件的邮件,支持HTML模板、多收件人和文件附件。基于nodemailer。
metadata:
short-description: 通过SMTP发送邮件
source:
repository: https://github.com/nodemailer/nodemailer
license: MIT
---
# Email Sender Tool
## Description
Send emails with HTML content, attachments, and multiple recipients via SMTP.
## Trigger
- `/send-email` command
- User requests to send email
- User needs email notification
## Usage
```bash
# Send simple email
python scripts/send_email.py --to "[email protected]" --subject "Hello" --body "Message content"
# Send with attachment
python scripts/send_email.py --to "[email protected]" --subject "Report" --body "See attached" --attachment "report.pdf"
# Send HTML email
python scripts/send_email.py --to "[email protected]" --subject "Newsletter" --html "template.html"
```
## Environment Variables
```env
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
[email protected]
SMTP_PASS=your-app-password
SMTP_FROM=Your Name <[email protected]>
```
## Tags
`email`, `smtp`, `notification`, `automation`
## Compatibility
- Codex: ✅
- Claude Code: ✅
This skill sends emails over SMTP using nodemailer, supporting HTML templates, multiple recipients, and file attachments. It is implemented in TypeScript and configured via environment variables for SMTP host, port, user, and password. The tool is designed for reliable programmatic email delivery from servers or automation scripts.
The skill constructs MIME-compliant messages with optional HTML body, plain-text fallback, and attached files, then hands them to nodemailer which speaks SMTP to the configured mail server. Recipients can be a single address, comma-separated list, or arrays for To/Cc/Bcc. Credentials and sender identity are provided via environment variables to keep secrets out of code.
How do I configure SMTP credentials?
Set SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, and SMTP_FROM as environment variables before running the process.
Can I send to multiple recipients and include attachments?
Yes. The skill accepts multiple recipients (comma-separated or arrays) and supports file attachments and inline assets via the message options.