Assure a valid email that .Net can actually send an email to is passed.


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. protected void ValidEmail(object source, ServerValidateEventArgs args)
  2. {
  3. try
  4. {
  5. var a = new MailAddress(args.Value);
  6. }
  7. catch (Exception ex)
  8. {
  9. args.IsValid = false;
  10. return;
  11. }
  12. args.IsValid = true;
  13. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.