# EmailReaderOptions

Immutable resource and preservation policy for EmailDocumentReader.

Class 

`OfficeIMO.Email`

**Namespace**

`OfficeIMO.Email`

**Assembly**

`OfficeIMO.Email`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[EmailReaderOptions.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L9)

**Modifiers**

sealed

Immutable resource and preservation policy for [EmailDocumentReader](/api/email/officeimo-email-emaildocumentreader/).

## Inheritance

- object
- EmailReaderOptions

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Read and Convert Email Messages](/docs/email/messages-and-conversion/) Guide
  
  Read EML, MSG, OFT, and TNEF (winmail.dat) messages, convert between them, check for conversion loss, stream large attachments, and render a message to PDF.
- [Read Untrusted Email Safely and Verify Conversions](/docs/email/safety-and-verification/) Guide
  
  Set input limits for untrusted email, read structured diagnostics, compare two messages semantically, and handle signed or encrypted messages.

## Usage

Explore 16 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 4

- Property [EmailDataOpenOptions.Email](/api/email/officeimo-email-data-emaildataopenoptions/#property-email)
- Property [EmailDocumentReader.Options](/api/email/officeimo-email-emaildocumentreader/#property-options)
- Property [EmailMailboxReaderOptions.MessageOptions](/api/email/officeimo-email-emailmailboxreaderoptions/#property-messageoptions)
- Property [EmailReaderOptions.Default](/api/email/officeimo-email-emailreaderoptions/#property-default)

### Accepted by parameters 12

- Constructor [EmailDataOpenOptions.EmailDataOpenOptions](/api/email/officeimo-email-data-emaildataopenoptions/#constructor-ctor-officeimo-email-emailreaderoptions-officeimo-email-contentlinereaderoptions-officeimo-email-store-emailstorereaderoptions-officeimo-email-addressbook-offlineaddressbookreaderoptions-nullable-officeimo-email-data-emaildataartifactkind-boolean) parameter `email`
- Method [EmailDocument.Load](/api/email/officeimo-email-emaildocument/#method-load-string-officeimo-email-emailreaderoptions-threading-cancellationtoken) parameter `options`
- Method [EmailDocument.LoadAsync](/api/email/officeimo-email-emaildocument/#method-loadasync-string-officeimo-email-emailreaderoptions-threading-cancellationtoken) parameter `options`
- Constructor [EmailDocumentReader.EmailDocumentReader](/api/email/officeimo-email-emaildocumentreader/#constructor-ctor-officeimo-email-emailreaderoptions) parameter `options`
- Method [EmailDocumentReader.DetectFormat](/api/email/officeimo-email-emaildocumentreader/#method-detectformat-io-stream-officeimo-email-emailreaderoptions) parameter `options`
- Constructor [EmailMailboxReaderOptions.EmailMailboxReaderOptions](/api/email/officeimo-email-emailmailboxreaderoptions/#constructor-ctor-officeimo-email-emailreaderoptions-officeimo-email-mboxvariant-int32) parameter `messageOptions`
- Method [EmailMapiProjection.Project](/api/email/officeimo-email-emailmapiprojection/#method-project-officeimo-email-emaildocument-nullable-system-int32-officeimo-email-emailreaderoptions-string-threading-cancellationtoken) parameter `options`
- Method [EmailPgp.Decrypt](/api/email/officeimo-email-emailpgp/#method-decrypt-officeimo-email-emaildocument-officeimo-security-iofficeopenpgpprovider-officeimo-security-officeopenpgpkeyset-officeimo-security-officeopenpgpoptions-officeimo-email-emailreaderoptions) parameter `contentReaderOptions`
- Method [EmailPgp.Verify](/api/email/officeimo-email-emailpgp/#method-verify-officeimo-email-emaildocument-officeimo-security-iofficeopenpgpprovider-officeimo-security-officeopenpgpkeyset-officeimo-security-officeopenpgpoptions-officeimo-email-emailreaderoptions) parameter `contentReaderOptions`
- Method [EmailSmime.Decrypt](/api/email/officeimo-email-emailsmime/#method-decrypt-officeimo-email-emaildocument-security-cryptography-x509certificates-x509certificate2-officeimo-security-iofficesecurityprovider-officeimo-security-cmsenvelopeoptions-officeimo-email-emailreaderoptions) parameter `contentReaderOptions`
- Method [EmailSmime.DecryptThenVerify](/api/email/officeimo-email-emailsmime/#method-decryptthenverify-officeimo-email-emaildocument-security-cryptography-x509certificates-x509certificate2-officeimo-security-iofficesecurityprovider-officeimo-security-cmsenvelopeoptions-officeimo-security-cmsverificationoptions-officeimo-email-emailreaderoptions) parameter `contentReaderOptions`
- Method [EmailSmime.Verify](/api/email/officeimo-email-emailsmime/#method-verify-officeimo-email-emaildocument-officeimo-security-iofficesecurityprovider-officeimo-security-cmsverificationoptions-officeimo-email-emailreaderoptions) parameter `contentReaderOptions`

Filter members 

Show inherited

## Constructors

`public EmailReaderOptions(long maxInputBytes = 268435456, int maxHeaderBytes = 1048576, int maxHeaderCount = 10000, int maxPartCount = 10000, int maxMimeDepth = 64, long maxAttachmentBytes = 134217728, long maxTotalAttachmentBytes = 536870912, int maxNestedMessageDepth = 16, bool includeAttachmentContent = true, bool preserveRawSource = false, int maxCompoundDirectoryEntries = 65536, int maxMapiPropertyCount = 100000, long maxDecodedPropertyBytes = 536870912, int maxTnefAttributeCount = 100000, int maxAttachmentCount = 10000, bool includeEmbeddedMessages = true)` [#](#constructor-ctor-int64-int32-int32-int32-int32-int64-int64-int32-boolean-boolean-int32-int32-int64-int32-int32-boolean)

[EmailReaderOptions.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L9)

Creates reader options.

Parameters

**maxInputBytes long = 268435456 optional**

**maxHeaderBytes int = 1048576 optional**

**maxHeaderCount int = 10000 optional**

**maxPartCount int = 10000 optional**

**maxMimeDepth int = 64 optional**

**maxAttachmentBytes long = 134217728 optional**

**maxTotalAttachmentBytes long = 536870912 optional**

**maxNestedMessageDepth int = 16 optional**

**includeAttachmentContent bool = true optional**

**preserveRawSource bool = false optional**

**maxCompoundDirectoryEntries int = 65536 optional**

**maxMapiPropertyCount int = 100000 optional**

**maxDecodedPropertyBytes long = 536870912 optional**

**maxTnefAttributeCount int = 100000 optional**

**maxAttachmentCount int = 10000 optional**

**includeEmbeddedMessages bool = true optional**

## 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 static EmailReaderOptions Default { get; }` [#](#property-default)

[EmailReaderOptions.cs:6](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L6)

Default bounded reader policy.

`public long MaxInputBytes { get; }` [#](#property-maxinputbytes)

[EmailReaderOptions.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L59)

Maximum artifact size accepted by the reader.

`public int MaxHeaderBytes { get; }` [#](#property-maxheaderbytes)

[EmailReaderOptions.cs:61](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L61)

Maximum bytes allowed in one MIME header section.

`public int MaxHeaderCount { get; }` [#](#property-maxheadercount)

[EmailReaderOptions.cs:63](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L63)

Maximum number of header fields in one entity.

`public int MaxPartCount { get; }` [#](#property-maxpartcount)

[EmailReaderOptions.cs:65](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L65)

Maximum MIME entity count.

`public int MaxMimeDepth { get; }` [#](#property-maxmimedepth)

[EmailReaderOptions.cs:67](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L67)

Maximum nested MIME depth.

`public long MaxAttachmentBytes { get; }` [#](#property-maxattachmentbytes)

[EmailReaderOptions.cs:69](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L69)

Maximum decoded bytes for one attachment.

`public long MaxTotalAttachmentBytes { get; }` [#](#property-maxtotalattachmentbytes)

[EmailReaderOptions.cs:71](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L71)

Maximum aggregate decoded attachment bytes.

`public int MaxNestedMessageDepth { get; }` [#](#property-maxnestedmessagedepth)

[EmailReaderOptions.cs:73](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L73)

Maximum embedded-message recursion depth.

`public bool IncludeAttachmentContent { get; }` [#](#property-includeattachmentcontent)

[EmailReaderOptions.cs:75](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L75)

Whether decoded attachment content is retained.

`public bool IncludeEmbeddedMessages { get; }` [#](#property-includeembeddedmessages)

[EmailReaderOptions.cs:77](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L77)

Whether embedded messages are parsed into nested documents. Attachment metadata remains available.

`public bool PreserveRawSource { get; }` [#](#property-preserverawsource)

[EmailReaderOptions.cs:79](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L79)

Whether original artifact bytes are retained for explicit lossless writing.

`public int MaxCompoundDirectoryEntries { get; }` [#](#property-maxcompounddirectoryentries)

[EmailReaderOptions.cs:81](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L81)

Maximum CFB directory entries accepted while reading MSG.

`public int MaxMapiPropertyCount { get; }` [#](#property-maxmapipropertycount)

[EmailReaderOptions.cs:83](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L83)

Maximum aggregate MAPI properties across an artifact and embedded messages.

`public long MaxDecodedPropertyBytes { get; }` [#](#property-maxdecodedpropertybytes)

[EmailReaderOptions.cs:85](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L85)

Maximum aggregate decoded MSG/TNEF property bytes and MIME body/semantic-part bytes, checked before materialization.

`public int MaxTnefAttributeCount { get; }` [#](#property-maxtnefattributecount)

[EmailReaderOptions.cs:87](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L87)

Maximum number of TNEF attributes.

`public int MaxAttachmentCount { get; }` [#](#property-maxattachmentcount)

[EmailReaderOptions.cs:89](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Reading/EmailReaderOptions.cs#L89)

Maximum aggregate attachment count across the message and nested messages.

<!-- PowerForge markdown artifact sha256:34DB7611A79FEEB8126345F37DC0B6562BDADF3BC31E2D6429F9D290BA2278E1 -->
