EmailAttachment Class

An attachment of an EmailMessage: a file, or an embedded message.

public sealed class EmailAttachment

Constructors

NameDescription
EmailAttachment()

EmailAttachment()

EmailAttachment.cs
public EmailAttachment()

No documentation is available.

Properties

NameDescription
ContentGets or sets the content of a file attachment.
ContentIdGets or sets the identifier of the content, without angle brackets, which an HTML body references with cid: URLs.
ContentTypeGets or sets the MIME type of the content, such as image/png.
EmbeddedMessageGets or sets the message of an attachment that is a message, or null for a file.
FileNameGets or sets the file name.
IsInlineGets or sets whether the attachment is shown in the body, such as an image of an HTML body, rather than listed as a file.

Gets or sets the content of a file attachment.

public ReadOnlyMemory<byte> Content { get; set; }

Property value

ReadOnlyMemory<byte>

Gets or sets the identifier of the content, without angle brackets, which an HTML body references with cid: URLs.

public string? ContentId { get; set; }

Property value

string?

Gets or sets the MIME type of the content, such as image/png.

public string ContentType { get; set; }

Property value

string

EmbeddedMessage

EmailAttachment.cs

Gets or sets the message of an attachment that is a message, or null for a file.

public EmailMessage? EmbeddedMessage { get; set; }

Property value

EmailMessage?

Gets or sets the file name.

public string? FileName { get; set; }

Property value

string?

Gets or sets whether the attachment is shown in the body, such as an image of an HTML body, rather than listed as a file.

public bool IsInline { get; set; }

Property value

bool

Methods

NameDescription
ToString()Returns the file name.

Returns the file name.

public override string ToString()

Returns

string The file name.