MapiAttachment

General

MapiAttachment represents a file or embedded-message attachment in a MAPI .msg email. Create attachments using the static factory methods FromBytes or FromStream, then add them to a MapiMessage via AddAttachment. Read the attachment content via LoadData or OpenRead. The Properties collection exposes low-level MAPI property streams for the attachment storage.

MapiAttachment representa un fitxer o adjunt de missatge incrustat en un correu electrònic MAPI ゚.msg . Crear ajunts utilitzant els mètodes estàtics d'obra ⌒FromBytesヽ o ゙FromStream, i després afegir-los a una ̋MapiMessage▽ via ∂ { PLOCHEHOLE DER 4 ∀ . Llegir el contingut del anexo mitjançant Ť{PLASSeHALLDER_5 ∫ o pŁACEHOGLDERE_6 ∞ . La col·lecció ̅Properties ≠ exposa fluxos de propietats MAPI de baix nivell per al magatzematge dels Ajuts.

Mètodes

SignatureDescription
FromBytes(filename: string, data: byte[], mimeType: string?, contentId: string?)Creates a MapiAttachment from a byte array with optional MIME type and Content-ID.
FromStream(filename: string, stream: Stream, mimeType: string?, contentId: string?)Creates a MapiAttachment by reading all bytes from stream.
LoadData(stream: Stream)Loads attachment binary data from stream into Data.
OpenRead()Returns a Stream positioned at the start of the attachment data for sequential reading.

Propietats

NameTypeAccessDescription
Filenamestring?ReadOriginal filename of the attached file, or null if not set.
Databyte[]ReadRaw binary content of the attachment.
MimeTypestring?ReadMIME content-type string (e.g. application/pdf), or null if not specified.
ContentIdstring?ReadContent-ID header value for inline MIME attachments, or null if not set.
EmbeddedMessageMapiMessage?ReadThe embedded MapiMessage when IsEmbeddedMessage is true; otherwise null.
PropertiesMapiPropertyCollectionReadLow-level MAPI property collection for this attachment’s storage.
IsEmbeddedMessageboolReadThe embedded MapiMessage when IsEmbeddedMessage is true; otherwise null.
IsStorageAttachmentboolReadTrue if the attachment is stored as a sub-storage in the CFB document rather than a stream.

Veure també

 Català