Chapter 26. The System.Web.Mail Namespace

The System.Web.Mail namespace allows you to send email messages from your ASP.NET application. This capability uses the built-in SMTP service included with IIS, and is similar to the CDO component used in traditional ASP development. The SMTP service maps its Inbox and Outbox to directories on the server. Message transfer is handled so that the Outbox is always empty and the Inbox never has an incoming queue.

Messages and attachments are encapsulated in MailMessage and MailAttachment objects and sent using the SmtpMail helper class, which provides a single Send() method. Figure 26-1 shows the types in this namespace.

The System.Web.Mail namespace

Figure 26-1. The System.Web.Mail namespace

Get ASP.NET in a Nutshell 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.