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
<PackageReference Include="OfficeIMO.Email.Html" Version="3.3.0" />
<PackageVersion Include="OfficeIMO.Email.Html" Version="3.3.0" />
<PackageReference Include="OfficeIMO.Email.Html" />
paket add OfficeIMO.Email.Html --version 3.3.0
#r "nuget: OfficeIMO.Email.Html, 3.3.0"
#:package OfficeIMO.Email.Html@3.3.0
#addin nuget:?package=OfficeIMO.Email.Html&version=3.3.0
#tool nuget:?package=OfficeIMO.Email.Html&version=3.3.0
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 | Versions 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. |
-
.NETFramework 4.7.2
- OfficeIMO.Email (>= 3.3.0)
- OfficeIMO.Html (>= 3.3.0)
- OfficeIMO.Html.Rtf (>= 3.3.0)
-
.NETStandard 2.0
- OfficeIMO.Email (>= 3.3.0)
- OfficeIMO.Html (>= 3.3.0)
- OfficeIMO.Html.Rtf (>= 3.3.0)
-
net10.0
- OfficeIMO.Email (>= 3.3.0)
- OfficeIMO.Html (>= 3.3.0)
- OfficeIMO.Html.Rtf (>= 3.3.0)
-
net8.0
- OfficeIMO.Email (>= 3.3.0)
- OfficeIMO.Html (>= 3.3.0)
- OfficeIMO.Html.Rtf (>= 3.3.0)
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.