OutlookMailMessage Class
Definition
- Assembly
- Bodu.Formats.Outlook.Pst.dll
- Package
- Bodu.Formats.Outlook.Pst 0.7.1
Represents one message of a mail store: its decoded properties with typed conveniences over the well-known scalars.
public sealed class OutlookMailMessage
- Inheritance
-
OutlookMailMessage
- Inherited Members
- Extension Methods
Remarks
Message views are bound to their owning OutlookMailStore session and decode their property context once, on first access. Every property remains reachable through Properties; the conveniences return null when the underlying property is absent.
Properties
Attachments
Gets the message's attachments, in attachment-table order.
public IReadOnlyList<OutlookMailAttachment> Attachments { get; }
Property Value
- IReadOnlyList<OutlookMailAttachment>
The attachment views, built once on first access; empty when the message has no attachment table.
Remarks
Each attachment-table row's identifier is the attachment object's subnode identifier; a row that references no attachment subnode is skipped under the tolerant levels.
Exceptions
- ObjectDisposedException
The owning session has been disposed.
- PstFileException
The container is malformed.
- OutlookPstFormatException
Under strict validation, an attachment-table row does not reference a valid attachment object subnode.
BodyHtml
Gets the HTML body.
public string? BodyHtml { get; }
Property Value
- string
The
PidTagHtmlpayload decoded through the message's internet code page (falling back to the message code page), or the value verbatim when the writer stored it as a string; null when absent. The body is decoded once and the same instance returned thereafter.
Exceptions
- ObjectDisposedException
The owning session has been disposed.
BodyRtf
Gets the RTF body, decompressed from PidTagRtfCompressed per MS-OXRTFCP.
public string? BodyRtf { get; }
Property Value
- string
The RTF text, or null when the property is absent or DecompressRtf is disabled (the raw payload stays available through Properties). The body is decompressed once and the same instance returned thereafter.
Exceptions
- ObjectDisposedException
The owning session has been disposed.
- OutlookPstFormatException
The compressed payload is malformed, fails its checksum, or decompresses beyond MaxDecompressedRtfBytes.
BodyText
Gets the plain-text body.
public string? BodyText { get; }
Property Value
EmbeddedDepth
Gets the embedded-message nesting depth of this view: zero for a message enumerated from a folder, one more for each level opened through OpenMessage().
public int EmbeddedDepth { get; }
Property Value
- int
The nesting depth.
InternetMessageId
Gets the internet message identifier.
public string? InternetMessageId { get; }
Property Value
MessageClass
Gets the message class (for example, IPM.Note).
public string? MessageClass { get; }
Property Value
Properties
Gets every decoded property of the message.
public MapiPropertyCollection Properties { get; }
Property Value
- MapiPropertyCollection
The tag-addressed property collection, decoded once on first access.
Exceptions
- ObjectDisposedException
The owning session has been disposed.
- PstFileException
The container is malformed.
ReceivedTime
Gets the message delivery time.
public DateTimeOffset? ReceivedTime { get; }
Property Value
- DateTimeOffset?
The
PidTagMessageDeliveryTimevalue, or null when absent.
Recipients
Gets the message's recipients, in recipient-table order.
public IReadOnlyList<OutlookRecipient> Recipients { get; }
Property Value
- IReadOnlyList<OutlookRecipient>
The recipient views, built once on first access; empty when the message has no recipient table.
Remarks
Recipients are row-resident: each recipient-table row's cells decode directly into the recipient's property collection, with code-page strings decoded under the message's encoding.
Exceptions
- ObjectDisposedException
The owning session has been disposed.
- PstFileException
The container is malformed.
- OutlookPstFormatException
Under strict validation, a recipient row carries an undecodable value.
SenderEmailAddress
Gets the sender email address.
public string? SenderEmailAddress { get; }
Property Value
SenderName
Gets the sender display name.
public string? SenderName { get; }
Property Value
SentTime
Gets the client submit time.
public DateTimeOffset? SentTime { get; }
Property Value
- DateTimeOffset?
The
PidTagClientSubmitTimevalue, or null when absent.
Subject
Gets the message subject, with the MS-PST subject-prefix marker removed.
public string? Subject { get; }
Property Value
TransportMessageHeaders
Gets the transport message headers.
public string? TransportMessageHeaders { get; }
Property Value
Methods
ToString()
Returns a textual form of the message for diagnostics.
public override string ToString()
Returns
- string
The subject, or the node identifier when absent.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |