# EmailMessage

A handle-free message view. Payload operations reopen its unchanged local source for their duration.

Class 

`OfficeIMO.Email`

**Namespace**

`OfficeIMO.Email`

**Assembly**

`OfficeIMO.Email`

**Source revision**

`3b680b1b6fb1` with working tree changes

**Source**

[EmailMessage.cs:69](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L69)

**Modifiers**

sealed

A handle-free message view. Payload operations reopen its unchanged local source for their duration.

## Inheritance

- object
- EmailMessage

## Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 2

- Property [EmailMessageAttachment.Message](/api/email/officeimo-email-emailmessageattachment/#property-message)
- Property [EmailMessageReadResult.Messages](/api/email/officeimo-email-emailmessagereadresult/#property-messages)

Filter members 

Show inherited

## Methods

`public EmailWriteResult Save(string path, bool overwrite = false, CancellationToken cancellationToken = default, EmailWriterOptions? options = null)` [#](#method-save-string-boolean-threading-cancellationtoken-officeimo-email-emailwriteroptions)

[EmailMessage.cs:87](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L87)

Exports a native email artifact with an atomic destination conflict policy.

Parameters

**path string required**

**overwrite bool = false optional**

**cancellationToken System.Threading.CancellationToken = default optional**

**options OfficeIMO.Email.EmailWriterOptions? = null optional**

Returns

`EmailWriteResult`

`public EmailAttachmentExtractionResult SaveAttachments(string directory, IEnumerable<int> indexes, CancellationToken cancellationToken = default, string? fileNamePrefix = null)` [#](#method-saveattachments-string-collections-generic-ienumerable-system-int32-threading-cancellationtoken-string)

[EmailMessage.cs:93](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L93)

Extracts selected top-level attachments through the bounded shared extractor.

Parameters

**directory string required**

**indexes System.Collections.Generic.IEnumerable<int> required**

**cancellationToken System.Threading.CancellationToken = default optional**

**fileNamePrefix string? = null optional**

Returns

`EmailAttachmentExtractionResult`

`public T? UseDocument<T>(Func<EmailDocument, T?> operation, CancellationToken cancellationToken = default)` [#](#method-usedocument-func-officeimo-email-emaildocument-threading-cancellationtoken)

[EmailMessage.cs:69](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L69)

Runs an owner operation with a full document and releases its source immediately afterward.

Type Parameters

**T**

Parameters

**operation System.Func<OfficeIMO.Email.EmailDocument, T?> required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`T?`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string Id { get; }` [#](#property-id)

[EmailMessage.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L34)

Stable item identifier within the source.

`public string SourcePath { get; }` [#](#property-sourcepath)

[EmailMessage.cs:36](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L36)

Absolute local source path.

`public string? FolderPath { get; }` [#](#property-folderpath)

[EmailMessage.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L38)

Store folder path, or null for an individual file.

`public string? Subject { get; }` [#](#property-subject)

[EmailMessage.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L40)

Message subject.

`public EmailAddress? From { get; }` [#](#property-from)

[EmailMessage.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L42)

Represented author.

`public IReadOnlyList<EmailAddress> To { get; }` [#](#property-to)

[EmailMessage.cs:44](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L44)

Primary recipients.

`public IReadOnlyList<EmailAddress> Cc { get; }` [#](#property-cc)

[EmailMessage.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L46)

Carbon-copy recipients.

`public IReadOnlyList<EmailAddress> Bcc { get; }` [#](#property-bcc)

[EmailMessage.cs:48](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L48)

Blind-carbon-copy recipients.

`public DateTimeOffset? Date { get; }` [#](#property-date)

[EmailMessage.cs:50](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L50)

Declared sent date.

`public DateTimeOffset? ReceivedDate { get; }` [#](#property-receiveddate)

[EmailMessage.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L52)

Received date when available.

`public string? TextBody { get; }` [#](#property-textbody)

[EmailMessage.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L54)

Plain-text body alternative, when present.

`public string? HtmlBody { get; }` [#](#property-htmlbody)

[EmailMessage.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L56)

Original HTML body alternative, when present. Use the HTML exporter for a safe projection.

`public string? RtfBody { get; }` [#](#property-rtfbody)

[EmailMessage.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L58)

RTF body alternative, when present.

`public IReadOnlyList<EmailMessageAttachment> Attachments { get; }` [#](#property-attachments)

[EmailMessage.cs:60](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L60)

Attachment metadata; reading this collection does not retain payloads.

`public EmailStoreItemContentAvailability? ContentAvailability { get; }` [#](#property-contentavailability)

[EmailMessage.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L62)

Local-cache availability reported by the store reader; null for individual files.

`public string ExportName { get; }` [#](#property-exportname)

[EmailMessage.cs:64](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Email/Workflows/EmailMessage.cs#L64)

Portable subject and source-identity filename stem for batch exports.

<!-- PowerForge markdown artifact sha256:40C1DDE6FB0A0355EECF82149C2A7373E34D9E9BD69CF67B7F4432A792CE76B6 -->
