This tutorial will show you how to send a simple email message with authentication using ASP.NET 2.0 and VB.NET

Sending a email with Priorities using ASP.NET 2.0 and VB.NET is actually very simple.

First, you will need to import the System.Net.Mail namespace.

The System.Net.Mail namespace contains the SmtpClient and MailMessage Classes that we need in order to send the email end the email and specify the user credentials necessary to send authenticated email.

We use the btnSubmit_Click event to do the work.

We then call the emailClient.Send to send the message using the variables from our ASP.NET coded page. We also instantiate a System.Net.NetworkCredential object with the necessary authentication info and then assign that object to the Credentials property of our SmtpClient object.

The front end .aspx page looks something like this:

The flow for the code behind page is as follows.

Download Source Files