md-to-eml
Skill0 starsChanged 9 days agoMITView on GitHub
Convert Markdown to RFC 5322 email (.eml) with inline CSS and CID images. Use when the user asks to convert to email, make an eml, or export markdown as an .eml file.
2 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- fabioc-aloha/Alex_ACT_Editionedited, first seen Oct 13, 2026
- fabioc-aloha/alex-cognitive-architectureedited, first seen Apr 26, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- fabioc-aloha/Alex_ACT_Edition★ 084% same
- fabioc-aloha/alex-cognitive-architecture★ 078% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository66 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/bootstrap-project/resources/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/bootstrap-project/resources/CLAUDE.mdCLAUDE.md
- act-tenetsSkill
- adversarial-reviewSkill
- annotate-screenshotSkill
- anti-hallucinationSkill
- ascii-chartSkill
- assess-brainSkill
- big-ideaSkill
- bootstrap-coreSkill
- bootstrap-projectSkill
- browser-toolsSkill
- chart-big-ideaSkill
- chart-interpretationSkill
- chart-vocabularySkill
- code-reviewSkill
- communication-craftSkill
- compile-brainSkill
- convertSkill
- corpus-qa-sweepSkill
- critical-thinkingSkill
- deep-reviewSkill
- doc-hygieneSkill
- docs-shellSkill
- docx-to-mdSkill
- ethical-reasoningSkill
- evaluate-before-adoptingSkill
- figure-generatorSkill
- flint-chartSkill
- flint-interactionsSkill
- flint-themeSkill
- git-workflowSkill
- html-to-mdSkill
- humanizerSkill
- install-visual-companionsSkill
- lint-clean-markdownSkill
- markdown-mermaidSkill
- markdown-sanitization-chainSkill
- md-to-htmlSkill
- md-to-txtSkill
- md-to-wordSkill
- meditationSkill
- mutation-testingSkill
- planSkill
- platform-awarenessSkill
- print-svg-style-guideSkill
- proactive-awarenessSkill
- problem-framing-auditSkill
- project-capability-authoringSkill
- project-statusSkill
- render-chartSkill
- render-verifySkill
- rich-emailSkill
- risk-analysisSkill
- security-and-hardeningSkill
- setup-dependenciesSkill
- setup-enterprise-stackSkill
- spikeSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 251
Not earning tokens if users must manually fix the same MIME issues on every conversion
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Md To Eml
Write in Markdown, send as professional email — works in any email client
Convert Markdown documents with YAML frontmatter into RFC 5322-compliant .eml files ready for governance, newsletter, and stakeholder communication workflows.
When to Use
- Sending formatted content via email clients (Outlook, Thunderbird, etc.)
- Newsletter or governance communication from Markdown sources
- Generating test emails for review before batch sending
- Converting documentation into distributable email format
- Creating email templates with consistent branding
- Stakeholder updates with embedded charts or diagrams
Supported Formatting
| Format | Status | Notes |
| Headings | ✅ | H1-H6 with inline styles |
| Bold/Italic | ✅ | Standard emphasis |
| Links | ✅ | Clickable hyperlinks |
| Images | ✅ | CID embedded as attachments |
| Code blocks | ✅ | Monospace, gray background |
| Inline code | ✅ | Highlighted |
| Tables | ✅ | HTML tables with borders |
| Blockquotes | ✅ | Indented with border |
| Lists | ✅ | Ordered and unordered |
| Mermaid diagrams | ⚠️ | Simple flowchart tables; unsupported source retained |
| Emoji | ✅ | Unicode preserved |
| Horizontal rules | ✅ | Styled dividers |
Key Features
| Feature | Details |
| YAML frontmatter | Maps to RFC 5322 headers (To, From, Subject, CC, Reply-To) |
| Email-safe HTML | Inline CSS with table-based layout (no <style> blocks) |
| Mermaid fallback | Simple flowchart tables; unsupported diagrams keep labeled source |
| CID images | Local images embedded as base64 multipart MIME attachments |
| Emoji preservation | Subject and body emoji render correctly across clients |
| Test mode | --test flag overrides recipients for safe preview |
Header values and --test-to reject control characters before conversion or
test-recipient overrides. Source and rendered HTML use the same executable-HTML
screening as the HTML converter; scripts, event handlers, and executable URLs
stop conversion without replacing an existing email. Literal HTML inside code
remains escaped. This screening is not a substitute for sanitizing untrusted
input, and conversion does not send email or prove mail-client behavior.
Usage
# Basic conversion
node skills/md-to-eml/scripts/md-to-eml.cjs newsletter.md
# With test recipient override (safe preview)
node skills/md-to-eml/scripts/md-to-eml.cjs newsletter.md --test --test-to me@example.com
# Embed images as CID attachments
node skills/md-to-eml/scripts/md-to-eml.cjs update.md --inline-images
# Debug mode (saves intermediate HTML)
node skills/md-to-eml/scripts/md-to-eml.cjs update.md --debugOptions Reference
| Option | Default | Description |
--test | off | Override recipients for safe preview |
--test-to ADDRESS | frontmatter from | Custom test recipient email |
--inline-images | off | Embed images as base64 CID attachments |
--debug | off | Save intermediate HTML for inspection |
Frontmatter Format
The YAML frontmatter maps directly to RFC 5322 email headers:
---
to: team@example.com
from: sender@example.com
subject: 📊 Weekly Update - Sprint 42
cc: manager@example.com
reply-to: noreply@example.com
---
| Field | RFC 5322 Header | Required | Notes |
to | To | ✅ | Primary recipient(s), comma-separated |
from | From | ✅ | Sender address |
subject | Subject | ✅ | Supports emoji |
cc | Cc | ❌ | Carbon copy recipients |
reply-to | Reply-To | ❌ | Reply address if different from From |
Email Client Compatibility
| Client | HTML | Images | Tables | Emoji |
| Outlook (Windows) | ✅ | ✅ CID | ✅ | ✅ |
| Outlook (Mac) | ✅ | ✅ CID | ✅ | ✅ |
| Gmail (Web) | ✅ | ✅ CID | ✅ | ✅ |
| Apple Mail | ✅ | ✅ CID | ✅ | ✅ |
| Thunderbird | ✅ | ✅ CID | ✅ | ✅ |
| Mobile (iOS/Android) | ✅ | ⚠️ varies | ✅ | ✅ |
Test Mode Workflow
- Write your newsletter/update in Markdown with frontmatter
- Convert with
--test --test-to your@email.com - Open the .eml file in your email client
- Review formatting, images, links
- Convert again without
--testfor production - Send via your email client or automation
Mermaid Diagrams in Email
Email clients cannot execute JavaScript. The supported simple graph/flowchart
subset becomes node and relationship tables. Unsupported diagram types or syntax
retain their complete original source in a labeled code block, not a rendered
diagram. Pre-render to PNG when a visual diagram is required.
┌─────────────────┐
│ Original Mermaid │ → Table Fallback
└─────────────────┘
flowchart LR → | Step | Description |
A --> B | A | Start |
B --> C | B | Process |
| C | End |For high-fidelity diagrams, pre-render to PNG and include as images.
Troubleshooting
| Problem | Cause | Solution |
| "pandoc not found" | pandoc not installed | Run /alex-act-one setup-dependencies |
| Images not showing | CID not supported | Use --inline-images flag |
| Formatting broken | Client strips styles | Use simpler formatting |
| Large file size | Too many images | Link images instead of embedding |
| Subject truncated | Too long | Keep under 60 characters |
| Emoji not showing | Old email client | Use text alternatives |
Limitations
- Email clients cannot execute JavaScript — simple flowcharts use tables; unsupported diagrams retain labeled source
- Complex CSS layouts may render differently across clients (Outlook vs Gmail vs Apple Mail)
- Inline images add to email size — consider linking for large image sets
- Some clients strip CSS — design for graceful degradation
Requirements
- Node.js 24+
- pandoc (for Markdown to HTML conversion)
- Shared runtime: keep the complete
scripts/shared/directory at the same relative location, including the image-path and HTML-screening helpers and their transitive imports.
Muscle Script
skills/md-to-eml/scripts/md-to-eml.cjs
Conversion Acceptance Decision Table
| Condition | Verdict | Action |
| Subject, From, To headers present and correct | Accept | Required fields for valid .eml |
| Missing or malformed email headers | Reject | Check frontmatter extraction |
| HTML body renders in Outlook/Gmail preview | Accept | Test in at least one client |
| Body shows raw HTML tags or broken layout | Reject | Check MIME Content-Type is text/html |
| Inline images display (CID or base64) | Accept | Verify no external URL references |
| Images missing or show broken icons | Reject | Embed as base64 or CID attachment |
| Links are clickable and point to correct URLs | Accept | Spot-check 2-3 links |
| Mermaid diagrams pre-rendered as inline images | Accept | Raw mermaid syntax is not email-safe |
| Mermaid diagrams show as code blocks | Warning | Expected for unsupported fallback; pre-render to PNG when visual output is required |
| File opens in default mail client without errors | Accept | Test .eml file import |
| Total .eml size >5MB | Warning | Compress images or link instead of embed |
| Plain-text MIME part included as fallback | Accept | Recommended for accessibility |
Related Skills
- md-to-html - sister converter for web page output
- md-to-word - sister converter for Word document output
- Markdown linting - validate the source with the project's linter or the
lint-clean-markdownskill
Falsifiability
- This skill is wrong if generated .eml files fail to render correctly in Outlook or Thunderbird, or if MIME structure is rejected by mail servers
- The header format is stale if RFC 5322 compliance requirements change or major mail clients alter their parsing
- Not earning tokens if users must manually fix the same MIME issues on every conversion
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

