This tutorial will show you how to send a simple email message using ASP.NET 2.0 and C#

Sending a email using ASP.NET 2.0 and C# 2.0 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.

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.

The front end .aspx page looks something like this:

The flow for the code behind page is as follows.

Download Source Files