
Create responsive email templates easily with MJML
The challenge of responsive emails
Creating responsive emails in HTML is still a delicate exercise today. Unlike classic web development, the world of email relies on very heterogeneous rendering engines, specificities unique to each email client (Outlook, Gmail, Apple Mail, etc.), and limited compatibility with modern web standards. As a result, a simple design can quickly require dozens of lines of code and many tricks to display correctly everywhere.
To overcome this difficulty, many tools have emerged. Solutions like Mailjet or Brevo offer powerful visual editors that allow you to quickly build responsive emails without touching a line of code. These platforms are particularly suitable for non-technical profiles or marketing teams.
However, they have a major limitation : your templates remain locked in the tool’s ecosystem. It is often difficult, if not impossible, to properly export templates to reuse them in another service.
MJML : an open-source solution for responsive emails
MJML, which stands for Mailjet Markup Language, is an open-source framework designed to simplify the creation of responsive HTML emails. Its goal is clear : to enable developers to create emails readable on all clients without having to manage the many technical constraints of HTML for email.
Instead of writing complex HTML, MJML offers a simpler and more expressive markup language, which can then be automatically compiled into HTML compatible with all email clients. This approach brings several advantages:
- Time saving : MJML tags are designed to abstract rendering issues.
- Readability : MJML code is clearer and more structured, making template maintenance easier.
- Portability : once converted to HTML, the code can be used in any email sending tool or service (SMTP, API, etc.).
By adopting MJML, you gain autonomy : your templates no longer depend on a proprietary tool. You keep control of your code, while benefiting from responsive rendering regardless of the recipient’s email client.
Creating templates with MJML
One of MJML’s major strengths lies in the diversity of possible approaches for creating templates. Whether you’re looking for a quick solution or want to build custom designs, MJML offers great flexibility.
Ready-to-use templates
To get started quickly, you can rely on existing examples available on the official MJML website (https://mjml.io/templates). These models cover common uses (newsletter, registration confirmation, etc.) and can be easily adapted to your needs.

Mailjet, the creator of MJML, also offers a gallery of ready-to-use templates : https://www.mailjet.com/saas-templates-creator/templates/. Just add your information (texts, images, links, colors…) to quickly get several template examples.

MJML provides comprehensive documentation for its components, available here : https://documentation.mjml.io. You’ll find all available tags (<mj-section>, <mj-column>, <mj-text>
, etc.), as well as usage examples.
And to test your templates live, the “Try it Live” online editor lets you write MJML code and immediately preview the result : https://mjml.io/try-it-live. It’s an excellent tool for quick iteration.

An experience close to visual editors
Finally, for those who prefer a more graphical approach, there is a Visual Studio Code extension called MJML Editor (https://github.com/cytostatic/mjml-editor). It allows you to drag and drop MJML components directly into your editor, bringing the experience closer to that of a visual builder, while keeping the flexibility of code.

From MJML to HTML : convert your templates for use anywhere
Once your MJML template is ready, all that’s left is to convert it to HTML so it can be used in your email sending system. This conversion is automatic and can be done in several ways depending on your needs.
The quick option : the online editor
The official MJML website offers a very handy online editor: https://mjml.io/try-it-live. Just paste your MJML code there to immediately get the HTML version ready to send. Handy for quick tests or to validate a rendering quickly.
The automated option : MJML libraries
For more advanced needs or integration into a backend application, there are conversion packages available in several languages: Node.js, PHP, Python, Ruby, React… and also in .NET.
For example, in .NET, there is the library Mjml.Net which allows you to load a .mjml
file, then generate the corresponding HTML.
Here is a sample code in C# :
In this snippet, you can see :
- Loading an MJML file containing placeholders (
{{UserName}}, {{Email}}
, etc.) - Substituting these values dynamically from a
request
object - Using the
MjmlRenderer
class to convert MJML to HTML ready to be sent
Once the HTML is generated, it can be integrated into any email sending service (via SMTP or API), without dependence on a specific platform.
Conclusion
MJML is a powerful and flexible solution for designing responsive emails without suffering the complex constraints of traditional HTML. Whether you are a developer or not, its accessible approach allows you to gain autonomy, efficiency, and portability. A real asset for creating professional, durable templates compatible with all email clients.