# New-OfficeEmailWriterOptions

Creates deterministic email writer settings through ordinary PowerShell parameters.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`None`

**Outputs**

`OfficeIMO.Email.EmailWriterOptions`

**Source**

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

Creates deterministic email writer settings through ordinary PowerShell parameters.

## Syntax

```
New-OfficeEmailWriterOptions
[-AllowLoss]
[-Base64LineLength <Int32>]
[-IncludeBccHeader]
[-MaxNestedMessageDepth <Int32>]
[-MaxOutputBytes <Int64>]
[-UsePreservedRawSource]
[<CommonParameters>]
```

[#](#method-new-officeemailwriteroptions-switchparameter-int32-switchparameter-int32-int64-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.

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

**-AllowLoss SwitchParameter optional**

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

**-Base64LineLength Int32 optional**

Maximum encoded characters on one Base64 body line.

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

<!-- PowerForge markdown artifact sha256:716C8070853F7BE6178E63CBB04D51FAE4E74ABEA7932EAEABE1E1172CD8311B -->
