EmailAttachment Class

Definition

Represents an email attachment.

public ref class EmailAttachment sealed
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Activatable(Windows.ApplicationModel.Email.IEmailAttachmentFactory2, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Activatable(Windows.ApplicationModel.Email.IEmailAttachmentFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class EmailAttachment final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(Windows.ApplicationModel.Email.IEmailAttachmentFactory2, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(Windows.ApplicationModel.Email.IEmailAttachmentFactory, 65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class EmailAttachment final
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.ApplicationModel.Email.IEmailAttachmentFactory2), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.ApplicationModel.Email.IEmailAttachmentFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class EmailAttachment
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.ApplicationModel.Email.IEmailAttachmentFactory2), 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.ApplicationModel.Email.IEmailAttachmentFactory), 65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class EmailAttachment
function EmailAttachment(fileName, data, mimeType)
Public NotInheritable Class EmailAttachment
Inheritance
EmailAttachment
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)
App capabilities
email emailSystem

Remarks

Attachments that you add to an email by using the EmailAttachment class will appear only in the Mail app. If users have any other mail program configured as their default mail program, the compose window will appear without the attachment. This is a known issue.

Constructors

EmailAttachment()

Initializes a new instance of the EmailAttachment class.

EmailAttachment(String, IRandomAccessStreamReference)

Initializes a new instance of the EmailAttachment class with the specified random access stream.

EmailAttachment(String, IRandomAccessStreamReference, String)

Initializes a new instance of the EmailAttachment class.

Properties

ContentId

Gets or sets a value that identifies the content of the attachment on a remote system.

ContentLocation

Gets or sets the location of an email attachment as a Uniform Resource Identifier (URI).

Data

Gets or sets the email attachment's data.

DownloadState

Gets or sets the download state of the email attachment.

EstimatedDownloadSizeInBytes

Gets or sets the estimated download size of the attachment.

FileName

Gets or sets the displayed file name for the email attachment.

Id

Gets the locally unique ID for the email attachment.

IsFromBaseMessage

Gets a Boolean value indicating if the attachment came from the base message.

IsInline

Gets or sets a Boolean property indicating if the attachment is included inline, in the body of the message.

MimeType

Gets or sets the MIME type of the attachment.

Applies to

See also