Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

EmailAttachment

Namespace OfficeIMO.Email
Assembly OfficeIMO.Email
Source revision a039964de4cc with working tree changes
Modifiers sealed

Represents a file, inline resource, or embedded item attachment.

Inheritance

  • Object
  • EmailAttachment

Usage

Explore 9 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.

Accepted by parameters 5

Constructors

public EmailAttachment() #

Methods

public Stream OpenContentStream() #
Returns: Stream

Opens decoded attachment content without transferring ownership of the attachment.

public async Task<Stream> OpenContentStreamAsync(CancellationToken cancellationToken = default) #
Returns: Task<Stream>

Asynchronously opens decoded attachment content.

Parameters

cancellationToken System.Threading.CancellationToken = default optionalposition: 0

Properties

public String? FileName { get; set; } #

Attachment filename.

public String? ContentType { get; set; } #

Declared MIME content type.

public IDictionary<String, String> ContentTypeParameters { get; } #

Declared MIME content-type parameters other than the attachment filename.

public String? ContentId { get; set; } #

Content-ID used by inline references.

public String? ContentLocation { get; set; } #

Content location used by inline references.

public Boolean IsInline { get; set; } #

True when the source marks the attachment as inline.

public Boolean IsMimeRelated { get; set; } #

True when the source places this part inside the MIME related-resource set. Writers also infer related membership from exact HTML Content-ID and Content-Location references.

public Boolean IsHidden { get; set; } #

True when Outlook marks the attachment hidden.

public Boolean IsContactPhoto { get; set; } #

True when the attachment is the picture for an Outlook contact.

public Int32 RenderingPosition { get; set; } #

RTF rendering position, or -1 when not rendered in the body.

public DateTimeOffset? CreatedDate { get; set; } #

Attachment creation timestamp.

public DateTimeOffset? ModifiedDate { get; set; } #

Attachment modification timestamp.

public String? LinkedPath { get; set; } #

Linked attachment path for by-reference attachment methods.

public Int64 Length { get; set; } #

Decoded payload length.

public Byte[]? Content { get; set; } #

Decoded content when requested by reader options.

public IEmailContentSource? ContentSource { get; set; } #

Reopenable decoded content used when retaining a byte array is undesirable. Writers prefer EmailAttachment.Content when both representations are present.

public EmailDocument? EmbeddedDocument { get; set; } #

Embedded message or Outlook item when the attachment is structured.

public Int32? MapiAttachMethod { get; set; } #

MSG attachment method, such as 1 for by-value or 5 for embedded message.

public IList<MapiProperty> MapiProperties { get; } #

Attachment-level MAPI properties.

public MapiPropertyBag Mapi { get; } #

Typed MAPI access backed by the exact EmailAttachment.MapiProperties collection.

public IDictionary<String, Byte[]> StructuredStorageStreams { get; } #

Relative CFB streams retained for an OLE, embedded MSG, or custom-storage attachment.

public IList<TnefAttribute> TnefAttributes { get; } #

Ordered raw attachment-level TNEF attributes.