MailAttachment Constructors

Definition

Initializes a new instance of the MailAttachment class. Recommended alternative: System.Net.Mail.

Overloads

MailAttachment(String)

Initializes a new instance of the MailAttachment class with the specified file name for the attachment. Sets the Encoding property to UUEncode by default. Recommended alternative: System.Net.Mail.

MailAttachment(String, MailEncoding)

Initializes a new instance of the MailAttachment class with the specified file name and encoding type for the attachment. Recommended alternative: System.Net.Mail.

MailAttachment(String)

Initializes a new instance of the MailAttachment class with the specified file name for the attachment. Sets the Encoding property to UUEncode by default. Recommended alternative: System.Net.Mail.

public:
 MailAttachment(System::String ^ filename);
public MailAttachment(string filename);
new System.Web.Mail.MailAttachment : string -> System.Web.Mail.MailAttachment
Public Sub New (filename As String)

Parameters

filename
String

The name of the attachment file.

Remarks

The mail attachment file is locked while the mail is being sent.

Applies to

MailAttachment(String, MailEncoding)

Initializes a new instance of the MailAttachment class with the specified file name and encoding type for the attachment. Recommended alternative: System.Net.Mail.

public:
 MailAttachment(System::String ^ filename, System::Web::Mail::MailEncoding encoding);
public MailAttachment(string filename, System.Web.Mail.MailEncoding encoding);
new System.Web.Mail.MailAttachment : string * System.Web.Mail.MailEncoding -> System.Web.Mail.MailAttachment
Public Sub New (filename As String, encoding As MailEncoding)

Parameters

filename
String

The name of the attachment file.

encoding
MailEncoding

The type of MailEncoding for the attachment.

Applies to