title: how can I make my button not to go through if my email address in not in the correct format?
body: <p>I have the required field validator and regular expression validator on my email address text box. Both of these validators are shown if the email has no value or its not in the correct format. However, when I click on the submit button and I try to input a wrong value (for example I input number 2) on the email text box, the program still pushes through the submit button function. Is there any trick or any references in which I can make the button not to continue until the email textbox has the correct format (abc@yahoo.com)? Thank you for any suggestions. :)</p>
  
  <p>Here is my email text box code:</p>
  
  <pre><code>&lt;asp:TextBox ID="txtCustomerEmailID" runat="server" Width="231px"&gt;&lt;/asp:TextBox&gt;
                                                                      &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                                                          ErrorMessage=" Email Address is Required." ForeColor="Red" ControlToValidate="txtCustomerEmailID"
                                                                          validationgroup="PersonalInfoGroup"
                                                                          &gt;&lt;/asp:RequiredFieldValidator&gt;
  </code></pre>
  
  <p>here is my submit order button</p>
  
  <pre><code>&lt;asp:Button ID="btnPlaceOrder" runat="server" OnClick ="btnPlaceOrder_Click"
                                                                      Style = "font-weight:700" Text="PlaceOrder" Width="90px" validationgroup="PersonalInfoGroup" /&gt;
  </code></pre>
  
  <p>Also, I have the email engine wherein when I click on the button, it will be directed to the email address. I will show the codes of the email engine because the error leads here when it pushes through with the wrong email address.</p>
  
  <pre><code>using (MailMessage mailMessage = new MailMessage())
          {
              mailMessage.From = new MailAddress(ConfigurationManager.AppSettings["Username"]);
              mailMessage.Subject = subject;
              mailMessage.Body = body;
              mailMessage.IsBodyHtml = true;
              mailMessage.To.Add(new MailAddress(recipientEmail));
              SmtpClient smtp = new SmtpClient();
              smtp.Host = ConfigurationManager.AppSettings["Host"];
              smtp.EnableSsl = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableSsl"]);
              System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();
              NetworkCred.UserName = ConfigurationManager.AppSettings["UserName"];
              NetworkCred.Password = ConfigurationManager.AppSettings["Password"];
              smtp.UseDefaultCredentials = false;
              smtp.Credentials = NetworkCred;
              smtp.Port = int.Parse(ConfigurationManager.AppSettings["Port"]);
              smtp.Send(mailMessage);
          }
  </code></pre>
  
  <p>and lastly, the error:
  The specified string is not in the form required for an e-mail address.</p>
  
  <pre><code>mailMessage.To.Add(new MailAddress(recipientEmail));
  </code></pre>