Summary

To summarize the ASP.NET’s SmtpEmail functionality, an e-mail form containing all the fields and configurable properties is shown in Listing 15.5. In Figure 15.2, you can see the application running. It allows users to enter the information with which the e-mail will be sent.

Figure 15.2. Sending an e-mail using the MailMessage object.

We’ll start with the Visual Basic version.

Listing 15.5. Visual Basic Example
 <%@ Import Namespace=”System.Web.Mail” %> <HTML> <head> <script language=”VB” id=”Script1” runat=”server”> Sub SendMyEMail (Obj As Object, E As EventArgs) Dim mailObj AS new MailMessage mailObj.From = Request.Form(“FromAddress”) ...

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.