email address validation

W

wizard04

I'm trying to validate an email address field before it is submitted.
I have read RFC 822 (http://www.faqs.org/rfcs/rfc822.html) but I'm not
sure I'm fully grasping it. As far as I understand, a convoluted
email address like andy."har<ri>\"son"@example.com would be
valid. Please correct me if I'm wrong.
 
D

Darko

I'm trying to validate an email address field before it is submitted.
I have read RFC 822 (http://www.faqs.org/rfcs/rfc822.html) but I'm not
sure I'm fully grasping it. As far as I understand, a convoluted
email address like andy."har<ri>\"son"@example.com would be
valid. Please correct me if I'm wrong.

I think google search would give you a zillion links that give you
complete scripts and examples.
 
J

Jon Slaughter

wizard04 said:
I'm trying to validate an email address field before it is submitted.
I have read RFC 822 (http://www.faqs.org/rfcs/rfc822.html) but I'm not
sure I'm fully grasping it. As far as I understand, a convoluted
email address like andy."har<ri>\"son"@example.com would be
valid. Please correct me if I'm wrong.


Well, you have a quoted string in there so its ok...

basically you have andy."..."@example.com

which is fine. Anything in a quoted string and it only looks odd because it
isn't really used(actually I have no idea why its used). So as far as the
lexer is concerned, thats all just one token inside the quotes and it
doesn't get parsed any farther(except possibly for quoted pairs).

In reality its not convoluted but just looks a bit strange(not sure how mail
servers handle the quoted string though).

Jon
 
W

wizard04

Thanks Jon :)

Anything in a quoted string and it only looks odd because it
isn't really used(actually I have no idea why its used).

I don't expect anyone to actually have an address like this; I'm just
being a perfectionist. ;-)
(not sure how mail servers handle the quoted string though).

Good question! My web host won't let me create an address with quotes,
so that says something. Probably best not to allow special characters
at all (except the .).
 
J

Jon Slaughter

wizard04 said:
Thanks Jon :)



I don't expect anyone to actually have an address like this; I'm just
being a perfectionist. ;-)


Good question! My web host won't let me create an address with quotes,
so that says something. Probably best not to allow special characters
at all (except the .).


Yeah... you might also try some other rfc's just to be sure. The one you
gave,

RFC 822 - STANDARD FOR THE FORMAT OF ARPA INTERNET TEXT MESSAGES

Might not be the standard for what is used for the mail protocol that we
commonly use(which I guess is smtp or whatever).
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
I'm trying to validate an email address field before it is submitted.
I have read RFC 822 (http://www.faqs.org/rfcs/rfc822.html) but I'm not
sure I'm fully grasping it. As far as I understand, a convoluted
email address like andy."har<ri>\"son"@example.com would be
valid. Please correct me if I'm wrong.

Since it is impossible to determine whether an actual address is correct
- here, *0723 is currently valid, but soon it will not be - there's no
point in rigorously checking the format (unless you are an issuer of new
addresses).

The only sensible tests are whether the field has been left empty, and
whether the field might be an E-address. See
<URL:http://www.merlyn.demon.co.uk/js-valid.htm#VEmA>.

It's a good idea to write the newsgroup c.l.j and its FAQ. See below.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top