title: Exception thrown within try catch
body: <p>I have a function to check whether an email entered is valid:</p>
  
  <pre><code>bool IsValidEmail(string email)
      {
          try
          {
              var addr = new System.Net.Mail.MailAddress(email);
              return addr.Address == email;
          }
          catch (Exception ex)
          {
              System.Diagnostics.Debug.WriteLine(ex.Message);
              return false;
          }
      }
  </code></pre>
  
  <p>Even though it's within a try/catch I still get an exception when an invalid email is entered stating:</p>
  
  <blockquote>
    <p>'The specified string is not in the form required for an e-mail address.'</p>
  </blockquote>
  
  <p>I have used this function in other applications and it works fine. Not sure what's going on with it now.</p>
  
  <p>Edit: Solution was my Exception settings, my VS was ignoring the try/catch</p>