# EmailWriteResult

Result of email artifact serialization.

Class 

`OfficeIMO.Email`

**Namespace**

`OfficeIMO.Email`

**Assembly**

`OfficeIMO.Email`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[EmailWriteResult.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Writing/EmailWriteResult.cs#L56)

**Modifiers**

sealed

Result of email artifact serialization.

## Inheritance

- object
- EmailWriteResult

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [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, Write, and Convert Email and Outlook Files](/docs/email/) Guide
  
  OfficeIMO.Email reads and writes EML, MSG, OFT, TNEF, PST, OST, OLM, mbox, calendar and contact files in .NET, with no Outlook installed.

## Usage

Explore 15 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 14

- Method [EmailDocument.Save](/api/email/officeimo-email-emaildocument/#method-save-string-officeimo-email-emailwriteroptions)
- Method [EmailDocument.SaveAsync](/api/email/officeimo-email-emaildocument/#method-saveasync-string-officeimo-email-emailwriteroptions-threading-cancellationtoken)
- Method [EmailDocument.SaveWithConflictPolicy](/api/email/officeimo-email-emaildocument/#method-savewithconflictpolicy-string-officeimo-email-emailfileconflictpolicy-officeimo-email-emailwriteroptions)
- Method [EmailDocument.SaveWithConflictPolicyAsync](/api/email/officeimo-email-emaildocument/#method-savewithconflictpolicyasync-string-officeimo-email-emailfileconflictpolicy-officeimo-email-emailwriteroptions-threading-cancellationtoken)
- Method [EmailDocumentWriter.Write](/api/email/officeimo-email-emaildocumentwriter/#method-write-officeimo-email-emaildocument-string-officeimo-email-emailfileformat)
- Method [EmailDocumentWriter.WriteAsync](/api/email/officeimo-email-emaildocumentwriter/#method-writeasync-officeimo-email-emaildocument-io-stream-officeimo-email-emailfileformat-threading-cancellationtoken)
- Method [EmailMailbox.Save](/api/email/officeimo-email-emailmailbox/#method-save-string-officeimo-email-emailmailboxwriteroptions)
- Method [EmailMailbox.SaveAsync](/api/email/officeimo-email-emailmailbox/#method-saveasync-string-officeimo-email-emailmailboxwriteroptions-threading-cancellationtoken)
- Method [EmailMailboxWriter.Write](/api/email/officeimo-email-emailmailboxwriter/#method-write-officeimo-email-emailmailbox-string)
- Method [EmailMailboxWriter.WriteAsync](/api/email/officeimo-email-emailmailboxwriter/#method-writeasync-officeimo-email-emailmailbox-string-threading-cancellationtoken)
- Method [EmailMailboxWriter.WriteEntries](/api/email/officeimo-email-emailmailboxwriter/#method-writeentries-collections-generic-ienumerable-officeimo-email-emailmailboxentry-io-stream-threading-cancellationtoken)
- Method [EmailMessage.Save](/api/email/officeimo-email-emailmessage/#method-save-string-boolean-threading-cancellationtoken-officeimo-email-emailwriteroptions)
- Method [EmailStoreEmlxWriter.Write](/api/email/officeimo-email-store-emailstoreemlxwriter/#method-write-officeimo-email-emaildocument-string)
- Method [EmailStoreEmlxWriter.WriteAsync](/api/email/officeimo-email-store-emailstoreemlxwriter/#method-writeasync-officeimo-email-emaildocument-string-threading-cancellationtoken)

### Accepted by parameters 1

- Method [EmailDocumentWriter.ToBytes](/api/email/officeimo-email-emaildocumentwriter/#method-tobytes-officeimo-email-emaildocument-officeimo-email-emailfileformat-officeimo-email-emailwriteresult) parameter `result`

Filter members 

Show inherited

## Methods

`public void ThrowIfLoss()` [#](#method-throwifloss)

[EmailWriteResult.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Writing/EmailWriteResult.cs#L56)

Throws when the operation was blocked or accepted known semantic loss.

## 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 long BytesWritten { get; }` [#](#property-byteswritten)

[EmailWriteResult.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Writing/EmailWriteResult.cs#L18)

Number of bytes written.

`public EmailFileFormat SourceFormat { get; }` [#](#property-sourceformat)

[EmailWriteResult.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Writing/EmailWriteResult.cs#L21)

Format represented by the input model before this operation.

`public EmailFileFormat TargetFormat { get; }` [#](#property-targetformat)

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

Requested artifact format.

`public IReadOnlyList<EmailDiagnostic> Diagnostics { get; }` [#](#property-diagnostics)

[EmailWriteResult.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Writing/EmailWriteResult.cs#L27)

Structured fidelity diagnostics.

`public bool HasErrors { get; }` [#](#property-haserrors)

[EmailWriteResult.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Writing/EmailWriteResult.cs#L32)

True when serialization produced at least one error diagnostic.

`public EmailArtifactSourceSelection SourceSelection { get; }` [#](#property-sourceselection)

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

Whether preserved bytes or regenerated model content produced the artifact.

`public EmailConversionLossDisposition LossDisposition { get; }` [#](#property-lossdisposition)

[EmailWriteResult.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Writing/EmailWriteResult.cs#L43)

Final disposition of known semantic loss.

`public EmailAttachmentContentLifetime AttachmentContentLifetime { get; }` [#](#property-attachmentcontentlifetime)

[EmailWriteResult.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Writing/EmailWriteResult.cs#L46)

Lifetime applied to attachment content sources during this operation.

`public IReadOnlyList<string> DiagnosticCodes { get; }` [#](#property-diagnosticcodes)

[EmailWriteResult.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Writing/EmailWriteResult.cs#L49)

Stable diagnostic codes in emission order.

`public bool UsedPreservedSource { get; }` [#](#property-usedpreservedsource)

[EmailWriteResult.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Writing/EmailWriteResult.cs#L52)

True when the original preserved bytes were emitted verbatim.

<!-- PowerForge markdown artifact sha256:93A57E9EF53E27271AA4C63A9F0A404D012684EF66273DEE89F0A8E9F7061B8B -->
