OfficeIMO.Email.Html 3.3.0

Prefix Reserved
dotnet add package OfficeIMO.Email.Html --version 3.3.0
                    
NuGet\Install-Package OfficeIMO.Email.Html -Version 3.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OfficeIMO.Email.Html" Version="3.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OfficeIMO.Email.Html" Version="3.3.0" />
                    
Directory.Packages.props
<PackageReference Include="OfficeIMO.Email.Html" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OfficeIMO.Email.Html --version 3.3.0
                    
#r "nuget: OfficeIMO.Email.Html, 3.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OfficeIMO.Email.Html@3.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OfficeIMO.Email.Html&version=3.3.0
                    
Install as a Cake Addin
#tool nuget:?package=OfficeIMO.Email.Html&version=3.3.0
                    
Install as a Cake Tool

OfficeIMO.Email.Html

OfficeIMO.Email.Html is the optional HTML bridge for OfficeIMO.Email. It selects an HTML, RTF, or plain-text body once, applies the shared untrusted HTML policy, indexes CID and content-location resources, and exposes a prepared HtmlConversionDocument to renderers and readers.

dotnet add package OfficeIMO.Email.Html
using OfficeIMO.Email;

EmailBodyProjectionResult projection = EmailBodyProjection.Create(message);
string safeHtml = projection.Html;
EmailBodyResource? logo = projection.ResolveResource("cid:logo@example.test");

if (logo is not null) {
    using FileStream output = File.Create("logo.bin");
    await logo.CopyToAsync(output);
}

For targeted image inspection and rewriting without creating a full body projection, use the bounded, network-free DOM view:

EmailHtmlImageDocument images = EmailHtmlImageDocument.Parse(message.Body.Html ?? string.Empty);

foreach (EmailHtmlImageReference image in images.Images) {
    if (image.Source == "logo.png") {
        images.SetImageSource(image.Index, "cid:logo@example.test");
    }
}

string rewrittenHtml = images.ToHtml();

Parse accepts either an HTML fragment or a complete document. Images reports explicit img[src] attributes in document order, SetImageSource rewrites one stable index, and ToHtml preserves fragment-versus-document shape. This workflow does not open local files or download remote resources.

Remote resources are blocked by default. Selecting AllowByConsumerResolver only retains eligible HTTP(S) references; this package never downloads them. Attachment content remains operation-scoped and is opened only through bounded resource reads.

EmailBodyProjectionOptions bounds each projection by indexed resource count, bytes per resource, and declared or read bytes across all resources. The defaults are 128 resources, 128 MiB per resource, and 256 MiB per projection. OpenReadStream, CopyTo, and their asynchronous counterparts let consumers process content without first allocating another full byte array. Repeated reads share the projection-wide budget. Body-only consumers can set IncludeResources to false to avoid indexing attachments.

OfficeIMO.Email.Image uses the prepared HTML and resource index for rendering. OfficeIMO.Reader.Email uses the same projection before producing safe text or Markdown, so those adapters do not choose bodies, sanitize markup, or resolve embedded resources independently.

The core OfficeIMO.Email package does not depend on HTML libraries. Install this bridge only when safe HTML, RTF fallback, resource resolution, rendering, or Markdown projection is needed. The dependency footprint is OfficeIMO.Email, OfficeIMO.Html, and OfficeIMO.Html.Rtf.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on OfficeIMO.Email.Html:

Package Downloads
OfficeIMO.Reader.Email

Unified email, MHTML, Outlook store, and Offline Address Book adapter for OfficeIMO.Reader.Core.

OfficeIMO.Email.Image

HTML-backed image rendering for OfficeIMO email documents.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.3.0 0 9/2/2026
3.2.7 185 8/29/2026
3.2.6 255 8/22/2026
3.2.5 298 8/21/2026
3.2.4 267 8/19/2026