Attachment

Attachment class

Represents an e-mail attachment.

public class Attachment : AttachmentBase, IAttachment, IPreferredTextEncodingProvider

Constructors

Name Description
Attachment(string) Initializes a new instance of the Attachment class.
Attachment(Stream, ContentType) Initializes a new instance of the Attachment class.
Attachment(Stream, string) Initializes a new instance of the Attachment class.
Attachment(string, ContentType) Initializes a new instance of the Attachment class.
Attachment(string, string) Initializes a new instance of the Attachment class.
Attachment(Stream, string, string) Initializes a new instance of the Attachment class.

Properties

Name Description
ContentDisposition { get; } Gets Content-Disposition header
ContentId { get; set; } Gets or sets the content id.
ContentStream { get; set; } Gets or sets the content stream.
ContentType { get; set; } Gets or sets the type of the content.
virtual Headers { get; } Gets headers collection of attachment.
IsEmbeddedMessage { get; } Gets a value indicating whether the attachment is an embedded message.
IsUri { get; } Gets a value indicating whether attachment is URI-attachment.
Name { get; set; } Gets or sets an attachment name
NameEncoding { get; set; } Gets or sets an encoding of attachment name
PreferredTextEncoding { get; set; } Gets or sets a preferred text encoding
TransferEncoding { get; set; } Gets or sets the transfer encoding.

Methods

Name Description
static CreateAttachmentFromString(string, ContentType) Creates the attachment from string.
static CreateAttachmentFromString(string, string) Creates the attachment from string.
static CreateAttachmentFromString(string, string, Encoding, string) Creates the attachment from string.
Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
virtual Save(Stream) Saves the specified stream.
virtual Save(string) Saves the specified file name.

See Also