Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Validating E-mails (97 and >)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Loungers

    Sorry to bother you, but is there a better way to check if an e-mail entered by the user is in the right format?

    That is I can check to see if there is a @ sign, or maybe it the e-mail has .com at the end of it, but then there are a lot of domains and if you are say in another country then the .com might not be the last thing in the string.

    I was trying to see if I get an error if I use the hyperlink, and do a mailto, but that is also not so accurate.

    I have the user enter e-mails in a textbox on the userform, and I need to vaidate that entry before moving on. Mind you I don't want to validate if the e-mail is working, just its format.

    Thanks for any suggestions?

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  2. #2
    5 Star Lounger
    Join Date
    Oct 2002
    Location
    Wellington, Wellington, New Zealand
    Posts
    621
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Validating E-mails (97 and >)

    Wassim

    I do not believe that there is a validation method that works short of sending a mail and confirming that a response comes back from a real person.

    The only syntax check possible is that it is a text string with no spaces, the @ sign and at least one full stop somewhere after the @ sign.
    Even then you will be defeated by users who really want to hide their real email address by entering a validly formatted one.
    e.g. nowhere@nowhere.com is likely to be invalid

  3. #3
    3 Star Lounger Jim Cone's Avatar
    Join Date
    Feb 2002
    Location
    Portland, Oregon, USA
    Posts
    238
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Validating E-mails (97 and >)

    Hello Wassim,

    There is an additional check you could make if you want to make the effort.
    You could verify the entry after the last dot by using a lookup table or array containing all the country codes plus the conventional endings... com, net, gov, edu etc.
    I complied a list of 256 country codes to satisfy my curiosity about where people were posting from.
    You can do the same by melding lists from...

    http://www-old.ics.uci.edu/pub/websoft/www...untry-codes.txt
    http://www.iso.org/iso/en/prods-services/i...t-en1-semic.txt

    There are other very similar lists available by doing a google search for "country codes".

    Hope this helps.

    Jim Cone
    San Francisco, CA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •