HtmlForgeX.Email

HtmlForgeX.Email is a standalone .NET library for creating professional, email-client-safe HTML emails in C# without writing any HTML, CSS, or JavaScript.

Key Differences from HtmlForgeX

FeatureHtmlForgeXHtmlForgeX.Email
OutputBrowser HTMLEmail-safe HTML
StylingExternal CSS/JSInline styles only
DOCTYPEHTML5XHTML 1.0 Strict
Components400+ browser components127+ email components
Dark ModeCSS variables@media (prefers-color-scheme)
OutlookN/AVML fallbacks

Installation

dotnet add package HtmlForgeX.Email

Quick Example

var email = new Email();
email.Body.EmailBox(box => {
    box.EmailHeading("Welcome!", 1);
    box.EmailText(text => text.Text("Thank you for joining us."));
    box.EmailButton(button => {
        button.WithText("Get Started")
              .WithHref("https://example.com")
              .WithStyle(EmailButtonStyle.Primary);
    });
});

var result = await email.RenderAsync();
// result.Html contains the complete email HTML

Component Categories

  • Layout — EmailBox, EmailSection, EmailRow, EmailColumn, EmailGrid
  • Text & Media — Headings, text, links, images, avatars
  • Tables — EmailTable, EmailDynamicTable, EmailKeyValueTable
  • Buttons — EmailButton, EmailButtonGroup, OTP codes
  • Utility Cards — 60+ specialized cards
  • Charts — Email-safe bar, donut, sparkline, heatmap
  • Theming — Dark mode, semantic color tokens
  • Attachments — ICS calendar, VCard, image embedding

API Reference