Introduction
Hi everyone, im not a professional developer by far.... but for many years when I began I struggled to find good tutorials for me as a beginner. All were alot more advanced & refered to items & means I had NO idea of at all which then made trying to teach yourself impossible!!.
I wanted Just simple straight to the point and the type that explained JUST what i needed to know to
progress, nothing more Nor less.
In this article I will show the beginners out there how to make a feedback form, that sends you the
contents in an email simply, using the System.net.mail Or i use System.web.mail namespace.
This can easily be developed on and hopefully helps a lot of the new comers to progression in mailing
from web pages.
Note this feedback form will only run on host's that are asp/2 compatible (windows) servers.
Main
Step 1:
Lets start by making a simple aspx page through visual studio, call it "Feedback.aspx" & don't add a
code behind page (no use here we'll script it in YAY!). Now the 1st couple of lines of our page should
read as below, if not change it to so.

Note: you'll see we add the session state to false so we dont get our form holding data, and i
always like to import our namespaces so do like above.
Also add Or make sure your document type & declarations are like below as its a good practice to get
into when creating W3C webpages by standards XHTML Strict is a must!.

Step 2:
the <body> of our document if it's an aspx page will already have a <form> element if not add one,
inside this lets add our feedback form controls i always use a table to keep things neat ... as code
below:

Pay particular attention to our submit button, the onclick : onserverclick="btn_Click()" we'll add
this code a little later.
Here's an image of how the layout should look Or you can dizzy it up to your own style & like:

Yay we're off and running, there's nothing in that block of code you really need pay attention to. All we
have really done if your looking at your page in design mode is add a table with 5 new controls ; Name,
email, subject, message & submit .These will be our email message area's, lets move on.
Step 3:
Just below our table lets add our label for the response once the feedback is submitted. Do so as
below, note i add the label text in Orange for effect of catching attention after a submission.

Now for the fun part lets get cracking at putting our coding skills to good use, Right back up the top of
our page, somewhere above the <head> element lets setup our functions & mail object.
Step 4:
First of all we'll add our <script> tags as so and be sure to specify language type:

then we add our page load function like so on the very next line, you'll notice the page load specifies if our page is a postback then set the label response to what ever we want to say once the email is sent Or else the user needs to fill in the email feild of our form.

Step 5:
Now last but not least our button click Or submit form. Let's go through the below code, if our request forms email field = to nothing then create new message, add from text, to text (Note: this will be your email address that you want to receive email on), subject from our drop down list, emailbody from our text area Or note i've also added some HTML, along with the users name and attached both via " code here" & " code here" statements, next is body format (Note: you can set this to what ever you like), smtp server (Note: this will be your email hosting server address to send emails) & finally our mail object name we created at the IF statement at our button click beginning.

Conclusion
And that My friends is just about it your page can now be uploaded to your ASP(windows) host and
send you form feedback to no end ! *smile* . I hope many of you enjoyed this and as you can see with
a little tinkering it could easily be added to, such as a user control for sending personal emails to
others, Or also add a fileupload control for email attachments.