Chapter 15. ASP.NET E-Mail Control


In this chapter

Creating E-Mail Messages

Using the MailMessage Object

Adding E-Mail Attachments

Setting the E-Mail Format

Setting E-Mail Priority

Setting E-Mail Encodings for the E-Mail Body and Attachments

ASP.NET introduces a new e-mail object called SmtpMail that replaces the former CDONTS object available with Microsoft Internet Information Server 4. SmtpMail is similar to the CDONTS object, providing basic e-mail functions with attachment capability for IIS 5. SmtpMail and all its associated objects are accessible through the System.Web.Mail namespace. The new object was created from the ground up to take advantage of the .NET Framework. As a result, it will function more efficiently and with less effort than CDONTS did with IIS 4 and classic ASP. These objects and enumerations are described in Table 15.1 and are discussed in the following sections.

Table 15.1. The System.Web.Mail Objects and Enumerations




The actual mail system for sending e- mails .


The actual mail object that contains the properties like MailTo, Recipient , etc.


The format of the e-mail; values are Text or HTML.


Creates a mail attachment.


Sets the priority of the mail message; values are High, Low or Normal.


Sets the encoding type; values are Base64 and UUEncode .


Special Edition Using ASP. NET
Special Edition Using ASP.Net
ISBN: 0789725606
EAN: 2147483647
Year: 2002
Pages: 233 © 2008-2017.
If you may any questions please contact us: