@emailens/engine
v0.18.20
Published
Email compatibility engine for HTML, MJML, Maizzle and React Email: transforms CSS per email client, scores compatibility, simulates dark mode, suggests fixes, and runs spam, accessibility, link and image quality analysis.
Maintainers
Readme
The rendering linter for email
Quick Start · What It Catches · Why Emailens · Supported Clients · API Docs
Your email looks perfect in Apple Mail. Gmail strips half the CSS. Outlook renders it in Word.
@emailens/engine analyzes HTML, React Email, MJML, and Maizzle against 21 email clients and scores compatibility before your email goes out. It catches the issues in the engine, in the terminal, in CI, and inside AI coding workflows.
If you want the fastest path to trying it locally, start with the CLI:
npx @emailens/cli lint email.htmlThe CLI is the recommended entry point for open-source usage. The engine is the lower-level library for builders, tools, and custom integrations.
emailens.dev is the hosted SaaS for shared previews, screenshots, visual diffs, and team workflows. The open-source packages are the local developer tooling.
Quick Start
Option 1: Try the CLI first
npx @emailens/cli lint email.htmlOption 2: Use the engine as a library
npm install @emailens/engineimport { auditEmail } from "@emailens/engine";
const html = `<html><body><div style="display:flex; gap: 12px;">...</div></body></html>`;
const report = auditEmail(html, { framework: "jsx" });
console.log(report.compatibility.scores["outlook-windows"]);The main entry runs in the browser as well as in Node, and a test keeps it that
way. The Node-only parts live in subpaths: @emailens/engine/compile (React
Email, MJML and Maizzle compilers) and @emailens/engine/server (DNS and
SpamAssassin checks).
What It Catches
- CSS compatibility across 21 clients
- Spam scoring and content hygiene signals
- Accessibility checks for contrast and semantics
- Image and link validation
- Inbox preview and client-specific rendering issues
- Template variable and overflow problems
- AI fix generation for structural issues
Every finding may include source positions, so a result can be pointed at, annotated, or fixed in place.
Measured on real clients
Support tables say what a client should do. We send probe emails to the real app and read the result off the screenshot, and where the two disagree, the screenshot wins. Each rule built that way lands with a test holding what the real client did, so you can check our work and rerun it after any change.
| Behaviour | How it was measured | Test |
| --- | --- | --- |
| Gmail on Android, dark mode | 880 colour pairs predicted and committed before sending, then read off the real app: 878 within 4/255 per channel | gmail-android-dark.test.ts |
| Outlook for Mac, dark mode | A sheet of 223 colour cells, light and dark; the rule is fitted on half the random colours and graded on the other half: 42 of 42 held-out cells within 4/255 (unreleased) | outlook-macos-dark.test.ts |
| Yahoo, Proton and Outlook quirks | One small probe per behaviour, such as Yahoo dropping a quoted font or a radial gradient, or Proton collapsing nbsp spacers | yahoo-*.test.ts, protonmail-*.test.ts, outlook-*.test.ts |
| Support-table corrections | Each cell a real inbox contradicted, with the date it was seen | scripts/observed-overrides.ts |
It runs in a fraction of a second per email across all 21 clients, so you can check every draft and keep real screenshots for the final send. How the whole loop works, and the blind score against real inboxes: emailens.dev/accuracy.
Why Emailens?
- Offline-first: runs locally with no account required
- Unified audit: a single tool checks CSS, spam, accessibility, links, images, and more
- Framework-aware: works with raw HTML, React Email, MJML, and Maizzle
- AI-ready: structural fixes can be generated with any model provider
- Programmable: use it in CI, editors, scripts, or custom tooling
Supported Email Clients
Each client links to its support page on emailens.dev, built from this package's data. Every feature across all 21 clients: emailens.dev/email-css.
| Client | ID |
|---|---|
| Gmail | gmail-web |
| Gmail Android | gmail-android |
| Gmail iOS | gmail-ios |
| Outlook 365 | outlook-web |
| Outlook (New) | outlook-windows |
| Outlook Classic | outlook-windows-legacy |
| Outlook iOS | outlook-ios |
| Outlook Android | outlook-android |
| Outlook for Mac | outlook-macos |
| Apple Mail | apple-mail-macos |
| Apple Mail iOS | apple-mail-ios |
| Yahoo Mail | yahoo-mail |
| Yahoo Mail Android | yahoo-mail-android |
| Yahoo Mail iOS | yahoo-mail-ios |
| Samsung Mail | samsung-mail |
| Thunderbird | thunderbird |
| HEY Mail | hey-mail |
| Proton Mail | protonmail |
| AOL Mail | aol |
| Fastmail | fastmail |
| Superhuman | superhuman |
Ecosystem
| Package | Use it for | |---|---| | @emailens/engine | Core library and analysis API | | @emailens/cli | Lint locally and in CI | | @emailens/mcp | AI agent access to email QA | | emailens/action | GitHub Action quality gate | | emailens/vscode | VS Code linting and preview | | emailens.dev | Hosted previews and team workflows |
License
MIT, Copyright 2025 Emailens
If this saved you from an Outlook surprise, a star helps other email developers find it.
