Skip to main content

Validate e-mail adress

  • March 3, 2016
  • 2 replies
  • 0 views

Alberto Ferraz

Hello,

How can validate a TEXT field if the email adress is in the correct format? (For example: myfriend.gmail.com is invalid)
Thanks
Alberto Ferraz

2 replies

Lanter Werner
  • Participating Frequently
  • March 3, 2016

Hello,

How can validate a TEXT field if the email adress is in the correct format? (For example: myfriend.gmail.com is invalid)
Thanks
Alberto Ferraz

This is a possible solution:

          declare MailAdr as type System.Net.Mail.MailAddress.

          declare expMess as type System.Exception.

          try

             set MailAdr to new System.Net.Mail.MailAddress(textBox2::Text)

          catch expMess

             invoke type System.Windows.MessageBox::Show(expMess::Message, "MailAddress invalid")

          end-try.

Werner Lanter


Alberto Ferraz
  • Author
  • Participating Frequently
  • March 5, 2016

Hello,

How can validate a TEXT field if the email adress is in the correct format? (For example: myfriend.gmail.com is invalid)
Thanks
Alberto Ferraz

Hello,

It works perfectly.

Thanks

Alberto Ferraz