Vue de l’ensemble
‘MapiAttachment’ représente un fichier ou une annexe de message intégré dans un email MAPI .msg. Créez des annexes en utilisant les méthodes d’usine statiques FromBytes ou Straam, puis ajoutez-les à un Mapimessage via AddAttack . Lire le contenu de l’annexe via ‘LoadDataetOpenRead`.. La collection ‘Properties’ expose des flux propriétaires MAPI de faible niveau pour le stockage de la annexion.
méthodes
| Signature | Description |
|---|
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. |
Propriétés
| Name | Type | Access | Description |
|---|
Filename | string? | Read | Original filename of the attached file, or null if not set. |
Data | byte[] | Read | Raw binary content of the attachment. |
MimeType | string? | Read | MIME content-type string (e.g. application/pdf), or null if not specified. |
ContentId | string? | Read | Content-ID header value for inline MIME attachments, or null if not set. |
EmbeddedMessage | MapiMessage? | Read | The embedded MapiMessage when IsEmbeddedMessage is true; otherwise null. |
Properties | MapiPropertyCollection | Read | Low-level MAPI property collection for this attachment’s storage. |
IsEmbeddedMessage | bool | Read | The embedded MapiMessage when IsEmbeddedMessage is true; otherwise null. |
IsStorageAttachment | bool | Read | True if the attachment is stored as a sub-storage in the CFB document rather than a stream. |
Voir aussi