mjmlio /mjml
MJML: the only framework that makes responsive email easy
★ 18,294⑂ 1,009👁 160⑃ 948● 2,124▤ 128
-1
日增长
+12
周增长
+27
月增长
18,294
stars
1,009
forks
160
watchers
948
prs
2,124
issues
128
releases
README
Developed by
---
| Introduction
| Installation
| Usage |
---
Introduction
MJML is a markup language created by Mailjet and designed to reduce the pain of coding a responsive email. Its semantic syntax makes the language easy and straightforward while its rich standard components library shortens your development time and lightens your email codebase. MJML’s open-source engine takes care of translating the MJML you wrote into responsive HTML.
Installation
You can install MJML with NPM to use it with NodeJS or the Command Line Interface. If you're not sure what those are, head over to Usage for other ways to use MJML.
bash
npm install mjml
Development
To work on MJML, make changes and create pull requests, download and install yarn for easy development.
bash
git clone https://github.com/mjmlio/mjml.git && cd mjml
yarn
yarn build
You can also run yarn build:watch to rebuild the package as you code.
Usage
Online
Don't want to install anything? Use the free online editor!
Applications and plugins
MJML comes with tools and plugins, check out:
- Visual Studio Code plugin (MJML is included). Also available at Visual Studio Code Marketplace and the Open VSX Registry or in the extensions tab of the Visual Studio Code app.
- Sublime Text plugin (MJML needs to be installed separately)
For more tools, check the Community page.
Command line interface
Compiles the file and outputs the HTML generated in output.html
bash
mjml input.mjml -o output.html
You can pass optional arguments to the CLI and combine them.
| argument | description | default value |
| -------------------------------- | ------------------------------------------------------ | ------------- |
| mjml [input] -o [output] | Writes the output to [output] | |
| mjml [input] -s | Writes the output to stdout | |
| mjml [input] -s --noStdoutFileComment | Writes the output to stdout without file comment in the first line | |
| mjml -w [input] | Watches the changes made to [input] (file or folder) | |
| mjml [input] --config.allowIncludes | Enables mj-include processing (true or false) | false |
| mjml [input] --config.allowMixedSyntax | Allows mixing block and CSS variable syntax when sanitizeStyles is enabled (true or false) | false |
| mjml [input] --config.beautify | Beautifies the output (true or false) | true |
| mjml [input] --config.includePath | Adds allowlisted include root(s), as a string path or JSON array of paths | |
| mjml [input] --config.minify | Minifies the output (true or false) | false |
| mjml [input] --config.minifyOptions | Options for HTML minifier, use minifyCss to control CSS minification | See mjml-cli documentation |
| mjml [Top issues
#1582Equal height columns within a group 42 comments · 2019-04-19#230Right to Left support38 comments · 2016-05-06#2010Dark Mode17 comments · 2020-08-18#2513iOS Gmail Dark Mode styling with CSS Blend Modes10 comments · 2022-08-04#1253fluid hero in outlook10 comments · 2018-06-22#1896Social elements not rendered horizontally on Outlook mobile web client8 comments · 2020-05-08#1401full-width mj-wrapper break rendering on outlook desktop8 comments · 2018-10-26#2742mjml-browser generated bundle uses some 'eval' code that causes CSP 'unsafe-eval' issue7 comments · 2023-09-08
Discussions
#3142Checking invitation role and conditional sections after rendering (free demo)0 comments · 2026-10-08#3006Injecting a <script> tag inside a template1 comments · 2025-10-24#2965Columns not displaying side-by-side in Outlook 20161 comments · 2025-08-11#2943MJML Examples – A Collection of Ready-to-Use MJML Modules0 comments · 2025-03-30#2936How are people writing tests?2 comments · 2025-02-14#2923Understanding and Resolving Issues with Image Dimensions in Percentage in MJML Editor2 comments · 2024-11-29#2918How to let the image being resposive(fill container width) between mobile and desktop?1 comments · 2024-11-14#2915<!--[if mso | IE]> This conditional check will only render the table in MSO or IE , but in my case it is applied in gmail ( chrome)1 comments · 2024-10-30
Latest release
v5.4.1 v5.4.1 2026-09-10What's Changed Fixes Fix crash in strict validation when an mj-include is denied by @sarmah-rup in https://github.com/mjmlio/mjml/pull/3115 Dependencies Address various dependency vulnerabilities by @dazgreer in https://github.com/mjmlio/mjml/pull/3133 Docs Note that templating tags break with mj-html-attributes by @Hashim1999164 in https://github.com/mjmlio/mjml/pull/3118 Add Emjay Ruby port with MJML 5.4 feature parity by @julik in https://github.com/mjmlio/mjml/pull/3131 Add Templatical to community contributions by @orkhanahmadov in https://github.com/mjmlio/mjml/pul