title: Validate email in Asp.Net MVC 3 doesn't work
body: <p>I have tried to follow guidelines found by Googling for validating email addresses, and used the following:</p>
  
  <pre><code>    [Required(ErrorMessage = "Email required.")]
      [ValidateEmail(ErrorMessage = "Valid email required.")]
      public string Email { get; set; }
  </code></pre>
  
  <p>And this is the attribute class:</p>
  
  <pre><code>public class ValidateEmailAttribute : RegularExpressionAttribute
  {
      public ValidateEmailAttribute() :  
          base(@"^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}$") {}  
  } 
  </code></pre>
  
  <p>Also found Googling for examples.</p>
  
  <p>However, I tried this version of an email attribute and another one, but neither stops me from entering whatever in the email field. I tried just entering a simple name, with spaces and all, and it went through just fine!</p>
  
  <p>Why isn't it kicking in and stopping this? The Required attribute works, it's just the regex one that doesn't.</p>