# EmailStoreEmlxWriter

Writes Apple Mail EMLX envelopes over the OfficeIMO.Email EML engine.

Class 

`OfficeIMO.Email.Store`

**Namespace**

`OfficeIMO.Email.Store`

**Assembly**

`OfficeIMO.Email`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[EmailStoreEmlxWriter.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Emlx/EmailStoreEmlxWriter.cs#L16)

**Modifiers**

sealed

Writes Apple Mail EMLX envelopes over the OfficeIMO.Email EML engine.

## Inheritance

- object
- EmailStoreEmlxWriter

Filter members 

Show inherited

## Constructors

EmailStoreEmlxWriter 2 overloads

`public EmailStoreEmlxWriter()` [#](#constructor-ctor)

[EmailStoreEmlxWriter.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Emlx/EmailStoreEmlxWriter.cs#L16)

Creates a writer with the default policy.

`public EmailStoreEmlxWriter(EmailStoreEmlxWriterOptions options)` [#](#constructor-ctor-officeimo-email-store-emailstoreemlxwriteroptions)

[EmailStoreEmlxWriter.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Emlx/EmailStoreEmlxWriter.cs#L19)

Creates a writer with an explicit policy.

Parameters

**options OfficeIMO.Email.Store.EmailStoreEmlxWriterOptions required**

## Methods

`public byte[] ToBytes(EmailDocument document)` [#](#method-tobytes-officeimo-email-emaildocument)

[EmailStoreEmlxWriter.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Emlx/EmailStoreEmlxWriter.cs#L28)

Serializes one message to complete EMLX bytes.

Parameters

**document OfficeIMO.Email.EmailDocument required**

Returns

`byte[]`

Write 2 overloads

`public EmailWriteResult Write(EmailDocument document, string filePath)` [#](#method-write-officeimo-email-emaildocument-string)

[EmailStoreEmlxWriter.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Emlx/EmailStoreEmlxWriter.cs#L40)

Atomically writes one EMLX file using a bounded, owner-only staging file.

Parameters

**document OfficeIMO.Email.EmailDocument required**

**filePath string required**

Returns

`EmailWriteResult`

`public EmailWriteResult Write(EmailDocument document, Stream stream)` [#](#method-write-officeimo-email-emaildocument-io-stream)

[EmailStoreEmlxWriter.cs:48](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Emlx/EmailStoreEmlxWriter.cs#L48)

Writes one EMLX artifact to a caller-owned stream without closing it.

Parameters

**document OfficeIMO.Email.EmailDocument required**

**stream System.IO.Stream required**

Returns

`EmailWriteResult`

WriteAsync 2 overloads

`public async Task<EmailWriteResult> WriteAsync(EmailDocument document, string filePath, CancellationToken cancellationToken = default)` [#](#method-writeasync-officeimo-email-emaildocument-string-threading-cancellationtoken)

Asynchronously stages message and attachment I/O and atomically writes one EMLX file.

Parameters

**document OfficeIMO.Email.EmailDocument required**

**filePath string required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<EmailWriteResult>`

`public async Task<EmailWriteResult> WriteAsync(EmailDocument document, Stream stream, CancellationToken cancellationToken = default)` [#](#method-writeasync-officeimo-email-emaildocument-io-stream-threading-cancellationtoken)

Asynchronously writes to a caller-owned stream without closing it.

Parameters

**document OfficeIMO.Email.EmailDocument required**

**stream System.IO.Stream required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`Task<EmailWriteResult>`

## 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 EmailStoreEmlxWriterOptions Options { get; }` [#](#property-options)

[EmailStoreEmlxWriter.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Emlx/EmailStoreEmlxWriter.cs#L24)

Writer policy.

<!-- PowerForge markdown artifact sha256:313C7CB160B83D014568E0F4181BAA3D1B5EA4BB2FD55202555B575E2145AC3B -->
