Ive started to dabble with .Net and C# just a little and Im trying to learn more.
Im making a page on my website and want to allow someone to send me an email through a form. I thought this would be a good project to tackle with asp.Net so I could learn something. So I have IIS running now and installed the framework goodies from the Microsoft website. Here is the C# code I have so far and I cant get it to execute, it always fires the catch statement:
<%@ Page Language="C#" %>
<%@ import Namespace="System.Web.Mail" %>
<script runat="server">
void SubmitButton_Click(object sender, EventArgs e) {
MessageLabel.Text = "";
try{
MailMessage FeedbackEmail = new MailMessage();
FeedbackEmail.To = "myemail@email.com";
FeedbackEmail.From = EmailFrom.Text;
FeedbackEmail.Subject = EmailSubject.Text;
FeedbackEmail.Body = EmailMessage.Text;
FeedbackEmail.BodyFormat = MailFormat.Text;
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(FeedbackEmail);
MessageLabel.Text = "Your message has been sent.";
}
catch{
MessageLabel.Text = "Your message could not be sent. Please make sure that the ";
MessageLabel.Text = MessageLabel.Text + "From, Subject, and Message fields are filled in.";
}
So thats all the further Ive gotten. Im sure the reason this doesnt submit is related to syntax but Im new so if this is something stupid please point out my newbieness.

Any comments would be appreciated. Thanks!