API Reference
EmailDocument
Format-neutral representation of an email or Outlook item.
Inheritance
- Object
- EmailDocument
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Property EmailDataOpenResult.EmailDocument
- Property EmailAttachment.EmbeddedDocument
- Method EmailDocument.Load
- Method EmailDocument.Load
- Method EmailDocument.Load
- Method EmailDocument.LoadAsync
- Method EmailDocument.LoadAsync
- Property EmailMailboxEntry.Document
- Property EmailReadResult.Document
- Property EmailSmimeDecryptionResult.DecryptedContent
- Property EmailSmimeVerificationResult.SignedContent
- Property OutlookTaskCommunication.EmbeddedTask
- Property EmailStoreAssociatedItem.Document
- Method EmailStoreCategoryList.ToAssociatedDocument
- Property EmailStoreItem.Document
Accepted by parameters
- Method EmailDocumentWriter.AnalyzeConversion
- Method EmailDocumentWriter.ToBytes
- Method EmailDocumentWriter.Write
- Method EmailDocumentWriter.Write
- Method EmailDocumentWriter.WriteAsync
- Method EmailDocumentWriter.WriteAsync
- Constructor EmailMailboxEntry.EmailMailboxEntry
- Method EmailMapiProjection.Project
- Method EmailSemanticComparer.Compare
- Method EmailSemanticComparer.Compare
- Method EmailSemanticComparer.CompareAsync
- Method EmailSemanticComparer.CompareAsync
- Method EmailSemanticComparer.CreateFingerprint
- Method EmailSemanticComparer.CreateFingerprintAsync
- Method EmailSmime.Decrypt
- Method EmailSmime.Verify
- Method OutlookTaskCommunication.Create
- Method EmailStoreCategoryList.Parse
- Method EmailStoreEmlxWriter.ToBytes
- Method EmailStoreEmlxWriter.Write
- Method EmailStoreEmlxWriter.Write
- Method EmailStoreEmlxWriter.WriteAsync
- Method EmailStoreEmlxWriter.WriteAsync
- Method EmailStorePstMutationTransaction.AddItem
- Method EmailStorePstMutationTransaction.ReplaceItem
- Method EmailStorePstWriter.AddItem
Constructors
public EmailDocument() #Methods
public static EmailDocument Load(String filePath, EmailReaderOptions options = null, CancellationToken cancellationToken = null) #EmailDocumentLoads one EML, MSG, OFT, or TNEF artifact with the default bounded policy. Use EmailDocumentReader when the caller also needs structured diagnostics.
Parameters
- filePath System.String
- options OfficeIMO.Email.EmailReaderOptions = null
- cancellationToken System.Threading.CancellationToken = null
public static EmailDocument Load(Byte[] data, EmailReaderOptions options = null, CancellationToken cancellationToken = null) #EmailDocumentLoads one EML, MSG, or TNEF artifact from memory. Use a source-name reader overload when bytes represent OFT. Use EmailDocumentReader when the caller also needs structured diagnostics.
Parameters
- data System.Byte[]
- options OfficeIMO.Email.EmailReaderOptions = null
- cancellationToken System.Threading.CancellationToken = null
public static EmailDocument Load(Stream stream, EmailReaderOptions options = null, CancellationToken cancellationToken = null) #EmailDocumentLoads one EML, MSG, or TNEF artifact without closing the stream. Seekable streams are read from the beginning and restored to their original position; non-seekable streams are read forward from their current position. Use EmailDocumentReader when the caller also needs structured diagnostics.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Email.EmailReaderOptions = null
- cancellationToken System.Threading.CancellationToken = null
public static async Task<EmailDocument> LoadAsync(String filePath, EmailReaderOptions options = null, CancellationToken cancellationToken = null) #Task<EmailDocument>Asynchronously loads one EML, MSG, or TNEF artifact with the default bounded policy.
Parameters
- filePath System.String
- options OfficeIMO.Email.EmailReaderOptions = null
- cancellationToken System.Threading.CancellationToken = null
public static async Task<EmailDocument> LoadAsync(Stream stream, EmailReaderOptions options = null, CancellationToken cancellationToken = null) #Task<EmailDocument>Asynchronously loads an artifact without closing the stream. Seekable streams are read from the beginning and restored to their original position; non-seekable streams are read forward.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Email.EmailReaderOptions = null
- cancellationToken System.Threading.CancellationToken = null
public EmailWriteResult Save(String filePath, EmailWriterOptions options = null) #EmailWriteResultSaves the document as EML, MSG, OFT, or TNEF, inferred from the destination filename.
Parameters
- filePath System.String
- options OfficeIMO.Email.EmailWriterOptions = null
public EmailWriteResult Save(String filePath, EmailFileFormat format, EmailWriterOptions options = null) #EmailWriteResultSaves the document in the explicitly selected artifact format.
Parameters
- filePath System.String
- format OfficeIMO.Email.EmailFileFormat
- options OfficeIMO.Email.EmailWriterOptions = null
public EmailWriteResult Save(Stream stream, EmailFileFormat format = Eml, EmailWriterOptions options = null) #EmailWriteResultSaves the document to a stream without closing it.
Parameters
- stream System.IO.Stream
- format OfficeIMO.Email.EmailFileFormat = Eml
- options OfficeIMO.Email.EmailWriterOptions = null
public Task<EmailWriteResult> SaveAsync(String filePath, EmailWriterOptions options = null, CancellationToken cancellationToken = null) #Task<EmailWriteResult>Asynchronously saves the document, inferring the format from the destination filename.
Parameters
- filePath System.String
- options OfficeIMO.Email.EmailWriterOptions = null
- cancellationToken System.Threading.CancellationToken = null
public async Task<EmailWriteResult> SaveAsync(String filePath, EmailFileFormat format, EmailWriterOptions options = null, CancellationToken cancellationToken = null) #Task<EmailWriteResult>Asynchronously saves the document in the explicitly selected artifact format.
Parameters
- filePath System.String
- format OfficeIMO.Email.EmailFileFormat
- options OfficeIMO.Email.EmailWriterOptions = null
- cancellationToken System.Threading.CancellationToken = null
public async Task<EmailWriteResult> SaveAsync(Stream stream, EmailFileFormat format = Eml, EmailWriterOptions options = null, CancellationToken cancellationToken = null) #Task<EmailWriteResult>Asynchronously saves the document to a stream without closing it.
Parameters
- stream System.IO.Stream
- format OfficeIMO.Email.EmailFileFormat = Eml
- options OfficeIMO.Email.EmailWriterOptions = null
- cancellationToken System.Threading.CancellationToken = null
public Byte[] ToBytes(EmailFileFormat format = Eml, EmailWriterOptions options = null) #Byte[]Serializes the document to memory.
Parameters
- format OfficeIMO.Email.EmailFileFormat = Eml
- options OfficeIMO.Email.EmailWriterOptions = null
public MemoryStream ToStream(EmailFileFormat format = Eml, EmailWriterOptions options = null) #MemoryStreamSerializes the document to a new writable memory stream positioned at the beginning.
Parameters
- format OfficeIMO.Email.EmailFileFormat = Eml
- options OfficeIMO.Email.EmailWriterOptions = null
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public EmailFileFormat Format { get; set; } #Source format used to create the document.
public OutlookItemKind OutlookItemKind { get; set; } #Typed Outlook item classification.
public String MessageClass { get; set; } #Outlook message class, such as IPM.Note.
public Nullable<Int32> OutlookCodePage { get; set; } #Primary MAPI code page used for legacy PT_STRING8 properties.
public EmailAddress From { get; set; } #Represented author/from address.
public EmailAddress Sender { get; set; } #Actual sender address when different from From.
public EmailAddress ReceivedBy { get; set; } #Recipient stamped by the message store as having received the message.
public EmailAddress ReceivedRepresenting { get; set; } #Represented recipient stamped by the message store.
public Nullable<DateTimeOffset> Date { get; set; } #Date declared by the message.
public Nullable<DateTimeOffset> ReceivedDate { get; set; } #Delivery/received timestamp when available.
public EmailMessageMetadata MessageMetadata { get; } #Common Outlook/MAPI message metadata.
public EmailProtectionInfo Protection { get; } #Protected-message classification and cryptographic payload handoff.
public IList<EmailHeader> Headers { get; } #Ordered, duplicate-preserving headers.
public IList<EmailRecipient> Recipients { get; } #Typed recipient collection.
public IList<EmailAttachment> Attachments { get; } #Attachment and embedded-item collection.
public IList<MapiProperty> MapiProperties { get; } #Root MAPI properties, including properties not projected onto common fields.
public MapiPropertyBag Mapi { get; } #Typed MAPI access backed by the exact MapiProperties collection.
public MapiPropertyPatch MapiWritePatch { get; } #Exact property overrides applied after normal typed projection by MSG, TNEF, PST, and semantic writers. Empty by default; use this only when an advanced property-level patch must win over a typed projection.
public OutlookUserPropertyCollection UserProperties { get; } #Outlook-compatible item user fields backed by the root MAPI property bag.
public IList<TnefAttribute> TnefAttributes { get; } #Ordered raw TNEF attributes when the source format is TNEF.
public OutlookAppointment Appointment { get; set; } #Typed appointment projection when OutlookItemKind is Appointment.
public OutlookMeetingCommunication MeetingCommunication { get; set; } #Typed meeting request, update, cancellation, response, or forward-notification envelope.
public OutlookContact Contact { get; set; } #Typed contact projection when OutlookItemKind is Contact.
public OutlookDistributionList DistributionList { get; set; } #Typed personal distribution-list projection.
public OutlookTask Task { get; set; } #Typed task projection when OutlookItemKind is Task.
public OutlookTaskCommunication TaskCommunication { get; set; } #Typed task request, acceptance, rejection, or update envelope.
public OutlookJournal Journal { get; set; } #Typed journal projection when OutlookItemKind is Journal.
public OutlookNote Note { get; set; } #Typed note projection when OutlookItemKind is Note.
public IDictionary<String, Object> Properties { get; } #Extensible source property bag for MAPI and format-specific metadata.
public Byte[] RawSource { get; set; } #Original artifact bytes when raw preservation was requested.