# New-OfficeEmailWriterOptions

Creates deterministic email writer 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.EmailWriterOptions`

**Source**

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

Creates deterministic email writer settings through ordinary PowerShell parameters.

## Syntax

```
New-OfficeEmailWriterOptions
[-Base64LineLength <Int32>]
[-ConversionLossPolicy <Block|Warn|Allow>]
[-IncludeBccHeader]
[-MaxNestedMessageDepth <Int32>]
[-MaxOutputBytes <Int64>]
[-UsePreservedRawSource]
[<CommonParameters>]
```

[#](#method-new-officeemailwriteroptions-int32-emailconversionlosspolicy-switchparameter-int32-int64-switchparameter)

Parameter set: `All Parameter Sets`

## Examples

### Preserve the original source when possible and block semantic loss.

```powershell
$options = New-OfficeEmailWriterOptions -UsePreservedRawSource -ConversionLossPolicy Block
$message | Save-OfficeEmail -Path .\Message.eml -Options $options -PassThru
```

## Parameters

**-Base64LineLength Int32 optional**

Maximum encoded characters on one Base64 body line.

**-ConversionLossPolicy EmailConversionLossPolicy optional**

Policy applied when the requested format cannot preserve known message semantics.

Possible values: `Block`, `Warn`, `Allow`

**-IncludeBccHeader SwitchParameter optional**

Write Bcc recipients into the message header.

**-MaxNestedMessageDepth Int32 optional**

Maximum embedded-message write depth.

**-MaxOutputBytes Int64 optional**

Maximum serialized artifact size.

**-UsePreservedRawSource SwitchParameter optional**

Emit an unchanged preserved source instead of regenerating the artifact when possible.

## 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:EE596FD1BD9FC1241B9AD83055151830C1EA8BE8EA208A804BD80BFADFE92BC0 -->
