473,388 Members | 1,198 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

email address validation

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.

Jun 26 '07 #1
5 2036
On Jun 26, 5:21 pm, wizard04 <wizar...@gmail.comwrote:
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.

Jun 26 '07 #2

"wizard04" <wi******@gmail.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
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
Jun 26 '07 #3
Thanks Jon :-)

On Jun 26, 12:22 pm, "Jon Slaughter" <Jon_Slaugh...@Hotmail.com>
wrote:
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 .).
Jun 26 '07 #4

"wizard04" <wi******@gmail.comwrote in message
news:11*********************@p77g2000hsh.googlegro ups.com...
Thanks Jon :-)

On Jun 26, 12:22 pm, "Jon Slaughter" <Jon_Slaugh...@Hotmail.com>
wrote:
>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 .).

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).

Jun 26 '07 #5
In comp.lang.javascript message <11**********************@g4g2000hsf.goo
glegroups.com>, Tue, 26 Jun 2007 15:21:51, wizard04 <wi******@gmail.com>
posted:
>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.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Jun 27 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Dynamo | last post by:
Hi The following script was taken from John Coggeshall's (PHP consultant) in his article on Zends site at http://www.zend.com/zend/spotlight/ev12apr.php // Get the email address to validate...
2
by: Angel | last post by:
Hi there, I need help pls..I'm using c# on a webform and I have this regex validation for email addresses: ValidationExpression ="\w+(\w+)*@\w+(\w+)*\.\w+(\w+)* " I'm having isssues when submit...
2
by: AFN | last post by:
Has anyone written any code to verify an email address against an SMTP server? I hear you can see if the address is an alias (catchall) versus a real account. I know you can telnet on port 25...
35
by: Mika M | last post by:
Simple question: Does Framework (1.1) contain any routine to check entered email-address is valid ? It's quite easy to make own code for that purpose, but why to do if Framework (1.1) contain...
1
by: Jim Dornbush | last post by:
Has anyone seen an updated regex expression from Microsoft for the email validation expression so that single quotes are allowed? I've been using the canned regex for emails, but recently been...
4
by: ianbarton | last post by:
Hello all I am trying to setup a feedback form on my webpage using some script provided by my ISP. I really don't know a lot about PHP and it's syntax etc. The feedback form only has 4...
7
by: e_matthes | last post by:
Hello everyone, I've read enough about email validation to know that the only real validation is having a user respond to a confirmation message you've sent them. However, I want to store the...
3
by: PythonistL | last post by:
In a form there is an input field where users insert their email address. How can I check if it is the valid email or that it consists `@' . Thank you. L.
2
by: Keith G Hicks | last post by:
I'm using the following code to send out email messages to a list of people in a database. My problem is that if I'm sending to 100 people and the 40th address is bad, it crashes on that one and...
5
by: Morgan Packard | last post by:
Hello, Is there a generally accepted technique for client-side email address validation? Can someone point me to a good, widely-used and tested script? thanks, -morgan
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.