Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Core
  3. PreMailer.Net

PreMailer.Net

MITC#v2.7.2

A C# library that moves CSS stylesheets to inline style attributes for maximum email client compatibility.

Visit WebsiteGitHubGitHub
686 stars117 forks0 contributors

What is PreMailer.Net?

PreMailer.Net is a C# library that converts CSS styles in HTML email templates into inline style attributes. It solves the problem of inconsistent CSS support across email clients by ensuring styles are applied directly to HTML elements, improving rendering reliability.

Target Audience

C# developers building email marketing systems, transactional email services, or any application that generates HTML emails requiring consistent cross-client compatibility.

Value Proposition

Developers choose PreMailer.Net for its robust handling of email-specific CSS quirks, built-in analytics tagging, and flexible options like media query preservation, all within a familiar .NET ecosystem.

Overview

C# library that moves your stylesheets to inline style attributes, for maximum compatibility with E-mail clients.

Use Cases

Best For

  • Converting HTML email templates with external CSS to inline styles
  • Ensuring consistent rendering across Gmail, Outlook, and other email clients
  • Adding UTM tracking parameters to links in marketing emails
  • Preserving responsive media queries while inlining other CSS
  • Processing email templates in .NET-based web applications
  • Automating email styling workflows in C# backend systems

Not Ideal For

  • Applications built on non-.NET stacks like Node.js or Python
  • High-throughput email services where minimal processing latency is critical
  • Teams needing integrated email client testing or preview tools beyond CSS inlining

Pros & Cons

Pros

Comprehensive CSS Inlining

Converts both external and internal CSS to inline styles, ensuring maximum email client compatibility as described in the README, which is critical for reliable rendering across clients like Outlook and Gmail.

Media Query Preservation

Allows selective preservation of media queries for responsive emails via the ignoreElements or preserveMediaQueries options, enabling mobile-friendly designs without inlining all styles.

Built-in Analytics Tagging

Includes AddAnalyticsTags method to automatically append UTM parameters to links, simplifying campaign tracking for marketing emails without manual URL editing.

Flexible DOM Access

Provides Document property for custom HTML manipulation using AngleSharp before inlining, useful for advanced scenarios like preprocessing or conditional styling.

Cons

External Dependency Risks

Relies on third-party libraries like AngleSharp for HTML parsing, which can introduce compatibility issues or breaking changes with updates, as noted in the dependency handling.

Performance Overhead

Processing involves downloading external CSS and DOM manipulation, which may add latency for large or complex templates, especially in high-volume email generation systems.

Limited Pseudo-Class Support

Unsupported pseudo-classes and elements are ignored and logged as warnings, requiring manual checks to avoid styling gaps, as admitted in the README's notes section.

Frequently Asked Questions

Quick Stats

Stars686
Forks117
Contributors0
Open Issues15
Last commit6 days ago
CreatedSince 2011

Tags

#google-analytics#email-templates#stylesheets#css-inlining#csharp#nuget-package#html-processing#email-template#dotnet#email-client-compatibility#css3#email#responsive-email#css

Built With

N
NuGet
.
.NET Core
C
C++

Links & Resources

Website

Included in

.NET21.2kCore21.2k
Auto-fetched 9 hours ago

Related Projects

MailKitMailKit

A cross-platform .NET library for IMAP, POP3, and SMTP.

Stars6,775
Forks865
Last commit22 hours ago
PapercutPapercut

Papercut SMTP -- The Simple Desktop Email Server

Stars3,287
Forks300
Last commit29 days ago
MimeKitMimeKit

A .NET MIME creation and parser library with support for S/MIME, PGP, DKIM, TNEF and Unix mbox spools.

Stars1,994
Forks388
Last commit22 hours ago
SmtpServerSmtpServer

A SMTP Server component written in C#

Stars810
Forks185
Last commit17 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub