# New-OfficeEmailReaderOptions

Creates bounded EML, MSG, and TNEF reader settings through ordinary PowerShell parameters.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`None`

**Outputs**

`OfficeIMO.Email.EmailReaderOptions`

**Source**

[NewOfficeEmailReaderOptionsCommand.cs:15](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Email/NewOfficeEmailReaderOptionsCommand.cs#L15) 

Creates bounded EML, MSG, and TNEF reader settings through ordinary PowerShell parameters.

## Syntax

```
New-OfficeEmailReaderOptions
[-ExcludeAttachmentContent]
[-MaxAttachmentBytes <Int64>]
[-MaxAttachmentCount <Int32>]
[-MaxCompoundDirectoryEntries <Int32>]
[-MaxDecodedPropertyBytes <Int64>]
[-MaxHeaderBytes <Int32>]
[-MaxHeaderCount <Int32>]
[-MaxInputBytes <Int64>]
[-MaxMapiPropertyCount <Int32>]
[-MaxMimeDepth <Int32>]
[-MaxNestedMessageDepth <Int32>]
[-MaxPartCount <Int32>]
[-MaxTnefAttributeCount <Int32>]
[-MaxTotalAttachmentBytes <Int64>]
[-PreserveRawSource]
[<CommonParameters>]
```

[#](#method-new-officeemailreaderoptions-switchparameter-int64-int32-int32-int64-int32-int32-int64-int32-int32-int32-int32-int32-int64-switchparameter)

Parameter set: `All Parameter Sets`

## Examples

### Read message diagnostics without retaining attachment payloads.

```powershell
$options = New-OfficeEmailReaderOptions -ExcludeAttachmentContent -MaxAttachmentBytes 25MB
Get-OfficeEmail -Path .\Message.msg -Options $options -AsResult
```

## Parameters

**-ExcludeAttachmentContent SwitchParameter optional**

Do not retain decoded attachment payloads in memory.

**-MaxAttachmentBytes Int64 optional**

Maximum decoded bytes for one attachment.

**-MaxAttachmentCount Int32 optional**

Maximum aggregate attachment count.

**-MaxCompoundDirectoryEntries Int32 optional**

Maximum CFB directory entries accepted while reading MSG.

**-MaxDecodedPropertyBytes Int64 optional**

Maximum aggregate bytes represented by decoded MSG property streams.

**-MaxHeaderBytes Int32 optional**

Maximum bytes allowed in one MIME header section.

**-MaxHeaderCount Int32 optional**

Maximum number of header fields in one entity.

**-MaxInputBytes Int64 optional**

Maximum artifact size accepted by the reader.

**-MaxMapiPropertyCount Int32 optional**

Maximum aggregate MAPI properties across a message and embedded messages.

**-MaxMimeDepth Int32 optional**

Maximum nested MIME depth.

**-MaxNestedMessageDepth Int32 optional**

Maximum embedded-message recursion depth.

**-MaxPartCount Int32 optional**

Maximum MIME entity count.

**-MaxTnefAttributeCount Int32 optional**

Maximum number of TNEF attributes.

**-MaxTotalAttachmentBytes Int64 optional**

Maximum aggregate decoded attachment bytes.

**-PreserveRawSource SwitchParameter optional**

Retain original artifact bytes for an explicit lossless write.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:7BEE5A52DD8E59CE96782D9BC22E608E458DBD12341FBE738A2C8F11F6D7C64C -->
