title: New to asp.net. Need help debugging this email form
body: <p>First of all, I am a php developer and most of .net is alien to me which is why I am posting here!</p>
  
  <p>I just migrated over a site from one set of webhosting to another.  The whole site is written in .net.  None of the site is database driven so most of it works, except for the contact form.  The output on the site simple states there was an error with "There has been an error - please try to submit the contact form again, if you continue to experience problems, please notify our webmaster."  This is just a simple message it pops out of it gets to the "catch" part of the email function.</p>
  
  <p>I went into web.config and changed the parameters:</p>
  
  <pre><code>    &lt;emailaddresses&gt;
          &lt;add name="System" value="roeland@hoyespharmacy.com"/&gt;
          &lt;add name="Contact" value="roeland@bythepixel.com"/&gt;
          &lt;add name="Info" value="roeland@bythepixel.com"/&gt;
      &lt;/emailaddresses&gt;
      &lt;general&gt;
          &lt;add name="WebSiteDomain" value="hoyespharmacy.com"/&gt;
      &lt;/general&gt;
  </code></pre>
  
  <p>Then the .cs file for contact contains the mail function EmailFormData():</p>
  
  <pre><code>private void EmailFormData()
  {
      try
      {
          StringBuilder body = new StringBuilder();
          body.Append("Name" + ": " + txtName.Text + "\n\r");
          body.Append("Phone" + ": " + txtPhone.Text + "\n\r");
          body.Append("Email" + ": " + txtEmail.Text + "\n\r");
          body.Append("Fax" + ": " + txtEmail.Text + "\n\r");
          body.Append("Subject" + ": " + ddlSubject.SelectedValue + "\n\r");
          body.Append("Message" + ": " + txtMessage.Text);
  
          MailMessage mail = new MailMessage();
          mail.IsBodyHtml = false;
          mail.To.Add(new MailAddress(Settings.GetEmailAddress("System")));
          mail.Subject = "Contact Us Form Submission";
          mail.From = new MailAddress(Settings.GetEmailAddress("System"), Settings.WebSiteDomain);
          mail.Body = body.ToString();
  
          SmtpClient smtpcl = new SmtpClient();
  
          smtpcl.Send(mail);
      }
      catch
      {
          Utilities.RedirectPermanently(Request.Url.AbsolutePath + "?messageSent=false");
      }
  }
  </code></pre>
  
  <p>How do I see what the actual error is.  I figure I can do something with the "catch" part of the function..  Any pointers?</p>
  
  <p>Thanks!</p>