Table of Contents

Constructor EmailContentRendering

Namespace
MailFathom.Application.EmailContent.Rendering
Assembly
MailFathom.Application.dll

EmailContentRendering(EmailContentHeaders, EmailBodyRepresentation, EmailBodyRepresentation?, bool, EmailAttachmentSummary)

Carries everything one parse of a stored message yields for a reader.

public EmailContentRendering(EmailContentHeaders Headers, EmailBodyRepresentation PlainTextBody, EmailBodyRepresentation? SanitizedHtmlBody, bool BodyIsEncrypted, EmailAttachmentSummary Attachments)

Parameters

Headers EmailContentHeaders

The normalized headers the message displays.

PlainTextBody EmailBodyRepresentation

The body as a reader would see it, already bounded and carrying its truncation metadata.

SanitizedHtmlBody EmailBodyRepresentation

The sanitized HTML body, present only when it was asked for and the message actually has an HTML body part.

BodyIsEncrypted bool

Whether the message's own body arrived inside a cryptographic envelope and could not be read here.

Attachments EmailAttachmentSummary

What the message carries besides its body, with one entry per attachment and no bytes.

Remarks

One rendering answers every question this read asks, because they are all answers about the same parse. Producing the attachment list from a second walk could describe a different message than the body did, and producing the headers from the stored row would describe a narrower one.

The bound is applied here rather than by the caller, because only the code holding the message can cut a body before the expensive part of reading it happens: markup is bounded before it is parsed and sanitized, so the work a crafted body can demand stays proportional to the bound instead of to what the sender wrote.

PlainTextBody is empty rather than absent for a message that displayed nothing, and empty as well when BodyIsEncrypted is set. The marker is what separates the two, so a caller never has to read an empty string as evidence about the message.