Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Jun 2001
    New York, New York, Lebanon
    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?

    <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
    Wellington, Wellington, New Zealand
    Thanked 0 Times in 0 Posts

    Re: Validating E-mails (97 and >)


    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. is likely to be invalid

  3. #3
    3 Star Lounger Jim Cone's Avatar
    Join Date
    Feb 2002
    Portland, Oregon, USA
    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...

    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