# New-OfficeEmailReaderOptions

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

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`None`

**Outputs**

`OfficeIMO.Email.EmailReaderOptions`

**Source**

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

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

## Syntax

```
New-OfficeEmailReaderOptions
[-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>]
[-NoAttachmentContent]
[-PreserveRawSource]
[<CommonParameters>]
```

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

Parameter set: `Options`

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Open Formats and Text Automation](/docs/pswriteoffice/open-text-formats/) Guide
  
  Use the smaller PSWriteOffice families for text, interchange, open formats, and managed message workflows. Includes examples and cmdlet links.
- [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.

## Examples

### Read message diagnostics without retaining attachment payloads.

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

## Parameters

**-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.

**-NoAttachmentContent SwitchParameter optional**

Do not retain decoded attachment payloads in memory.

**-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).

<!-- PowerForge markdown artifact sha256:0F269B39703A5141D2ABE37C34BA4E8EF1011C5C1AA6189F8EB055147A8DD2A7 -->
