Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

EmailAttachment

OfficeIMO.Email

Namespace
OfficeIMO.Email
Assembly
OfficeIMO.Email
Source revision
be6c300e4ab1 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() #

Opens decoded attachment content without transferring ownership of the attachment.

Returns

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

Asynchronously opens decoded attachment content.

Parameters

cancellationToken System.Threading.CancellationToken = default optional

Returns

Task<Stream>

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 bool IsInline { get; set; } #

True when the source marks the attachment as inline.

public bool 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 bool IsHidden { get; set; } #

True when Outlook marks the attachment hidden.

public bool IsContactPhoto { get; set; } #

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

public int 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 long 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 int? 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.