O'Reilly logo

Special Edition Using® Microsoft® ASP.NET by Richard Leinecker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating E-Mail Messages

In this section, we’ll talk about two ways to send e-mail messages. The first is simple, the second is more complicated but offers additional flexibility.

Creating Simple E-Mail Messages

Creating an e-mail is quite simple using the SmptMail object. Because the Send() method of the object is overloaded, it can take several variations of information. You can send an e-mail in two basic ways: pass all the components of an e-mail to the object separately, or pass it a MailMessage object. First look at passing separate components of an e-mail to the Send method by studying Listing 15.1.

Let’s first look at a VB example.

Listing 15.1. Visual Basic Example to Send Mail
 <%@ Import Namespace=”System.Web.Mail” %> <HTML> <head> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required