
528
|
Chapter 27: The System.Web.Mail Namespace
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
MailAttachment
System.Web.Mail (system.web.dll)
class
This class encapsulates an attachment to an email message. The constructor takes a
string argument that identifies the local path to the file, as in MailAttachment(@"c:\temp\
report.pdf"). An optional second argument lets you set the encoding (which will be UUEn-
code if omitted). Once you create an instance of MailAttachment, you can add it to an
instance of the MailMessage class with the MailMessage.Attachments collection. The easiest way
to do this is through the Add( ) method of the MailMessage.Attachments class, like this: objMes-
sage.Attachments.Add(objAttachment).
MailEncoding
System.Web.Mail (system.web.dll)
serializable
enum
This enumeration sets the BodyEncoding property of the MailMessage class and the Encoding
property of the MailAttachment class.
Hierarchy
System.Object ➝ System.ValueType ➝ System.Enum(System.IComparable, System.IFor-
mattable, System.IConvertible)
➝ MailEncoding
Returned By
MailAttachment.Encoding
Passed To
MailAttachment.MailAttachment( )
MailFormat
System.Web.Mail (system.web.dll)
serializable
enum
This enumeration sets the BodyFormat property of the MailMessage class. If you use Html, you
can include standard HTML markup tags in the Body property of a MailMessage ...