72
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill aidotnet/moyucode --skill nodemailer- SKILL.md3.9 KB
Overview
This skill sends email from Node.js applications using a robust, production-ready mailer. It supports SMTP, OAuth2 (for providers like Gmail), attachments, embedded images, and HTML templates for rich messages. The API is TypeScript-friendly and works well for transactional notifications, reports, and user onboarding emails.
How this skill works
You create a transporter configured with SMTP credentials or OAuth2 tokens, then call sendMail with message options (from, to, subject, text, html). Attachments and inline images are passed in an attachments array with file paths, Buffers, or content strings. For high-volume use, you can queue sends and apply rate limiting to avoid provider throttling.
When to use it
- Send transactional emails (password resets, receipts, confirmations).
- Deliver scheduled or periodic reports with PDF or spreadsheet attachments.
- Send HTML marketing or onboarding emails with templated content.
- Embed images inside emails using CID for branded content.
- Integrate with Gmail via OAuth2 to avoid storing raw passwords.
Best practices
- Keep credentials and OAuth tokens in environment variables or a secrets store.
- Use HTML templates and inline CSS for consistent cross-client rendering.
- Attach only required files and stream large attachments to avoid memory spikes.
- Implement a queue with rate limiting and retries to handle provider limits and transient failures.
- Verify SPF/DKIM/DMARC and use a proper from-domain to improve deliverability.
Example use cases
- Welcome emails with personalized HTML templates and a CTA button.
- Automated monthly reports sent as PDF attachments to stakeholders.
- Password reset emails with short plaintext and an HTML fallback.
- Embedding company logo in newsletters using CID-linked images.
- Gmail-based sending using OAuth2 to manage app-level authorization.
FAQ
Yes. Use the attachments array to attach files by path, Buffer, or content, and set a cid to embed images referenced from the HTML.
How do I avoid being rate-limited by email providers?
Implement an email queue with delays, batch sends, and exponential backoff for retries. Monitor provider quotas and spread traffic over time.