
MailPriority | 529
Mail
Namespace
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Hierarchy
System.Object ➝ System.ValueType ➝ System.Enum(System.IComparable, System.IFor-
mattable, System.IConvertible)
➝ MailFormat
Returned By
MailMessage.BodyFormat
Passed To
MailMessage.BodyFormat
MailMessage
System.Web.Mail (system.web.dll)
class
This class encapsulates an email message. To send an email message programmatically,
create a MailMessage object, set the appropriate properties, and use the SmtpMail.Send( )
method.
The properties of the MailMessage class are fairly straightforward and include all the
typical details entered in an email program, such as subject, priority, and the email
addresses for the sender, recipient, and any carbon-copied recipients (all as strings).
You can also use the Attachments collection to add MailAttachment objects to a message.
The actual body of the email message is set as a string through the Body property. You
will have to add line return characters as required. If you set the BodyFormat property to
MailFormat.Html, you can also insert standard HTML markup tags.
Passed To
SmtpMail.Send( )
MailPriority
System.Web.Mail (system.web.dll)
serializable
enum
This enumeration sets the Priority property of a MailMessage object.
public class MailMessage {
// Public Constructors
public MailMessage();
// Public Instance Properties ...