Using the MailMessage Object

An alternative way of sending an e-mail is to use the MailMessage object. After the object is created, you need only to provide all the necessary properties of the object to complete the e-mail and send it. Table 15.2 shows the properties of the MailMessage object with a brief description for each one.

Table 15.2. MailMessage Properties
Property Description
From The e-mail address of the sender.
To The e-mail address of the recipient.
Subject The subject of the e-mail.
CC Recipients to be copied on the e-mail.
BCC Recipients to be blind-copied on the e-mail.
Priority Priority of the e-mail message: Low, High, or Normal.
BodyEncoding Type of encoding for the e-mail: Base64 or UUEncode.
BodyFormat Type of formatting ...

Get Special Edition Using® Microsoft® ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.