MapiAttachmentBuilder Class
An attachment of an item to write: a file, or an embedded message.
public sealed class MapiAttachmentBuilderConstructors
| Name | Description |
|---|---|
| MapiAttachmentBuilder() |
MapiAttachmentBuilder()
MapiAttachmentBuilder.cspublic MapiAttachmentBuilder()No documentation is available.
Properties
| Name | Description |
|---|---|
| ContentId | Gets or sets the content identifier, which an HTML body uses to show the attachment inline (cid: URLs). |
| DisplayName | Gets or sets the display name of the attachment. |
| EmbeddedMessage | Gets or sets the embedded message, for an attachment that is a message. |
| FileName | Gets or sets the file name of the attachment. The writer also uses it as the long file name and the display name when they are not set. |
| IsHidden | Gets or sets whether the attachment is hidden, such as an image shown inline. |
| LongFileName | Gets or sets the full file name of the attachment. |
| MimeType | Gets or sets the MIME type of the content. |
| Properties | Gets the properties of the attachment. The other members of the builder read and write them. |
ContentId
MapiAttachmentBuilder.csDisplayName
MapiAttachmentBuilder.csEmbeddedMessage
MapiAttachmentBuilder.csGets or sets the embedded message, for an attachment that is a message.
public MapiMessageBuilder? EmbeddedMessage { get; set; }Property value
FileName
MapiAttachmentBuilder.csIsHidden
MapiAttachmentBuilder.csLongFileName
MapiAttachmentBuilder.csMimeType
MapiAttachmentBuilder.csProperties
MapiAttachmentBuilder.csGets the properties of the attachment. The other members of the builder read and write them.
public MapiPropertyBag Properties { get; }Property value
Methods
| Name | Description |
|---|---|
| FromContent(string, byte[], string?) | Creates an attachment from the content of a file. |
| FromMessage(MapiMessageBuilder) | Creates an attachment that contains a message. |
| SetContent(byte[]) | Sets the content of the attachment. |
| SetContent(Stream) | Sets a stream the writer reads the content of the attachment from, block by block, when it writes the item. The writer does not dispose it. |
FromContent(string, byte[], string?)
MapiAttachmentBuilder.csCreates an attachment from the content of a file.
public static MapiAttachmentBuilder FromContent(string fileName, byte[] content, string? mimeType = null)Parameters
fileNamestring- The file name of the attachment.
contentbyte[]- The content.
mimeTypestring?- The MIME type of the content, or
null.
Returns
MapiAttachmentBuilder The attachment.
FromMessage(MapiMessageBuilder)
MapiAttachmentBuilder.csCreates an attachment that contains a message.
public static MapiAttachmentBuilder FromMessage(MapiMessageBuilder message)Parameters
messageMapiMessageBuilder- The embedded message.
Returns
MapiAttachmentBuilder The attachment.