note 70912 added to ref.mail
| From: | furrykefatgmaildotcom at osu1 dot php dot net | Date: | Fri, 03 Nov 2006 22:38:20 +0000 |
| Subject: | note 70912 added to ref.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119352@lists.php.net to get a copy of this message | ||
If you use a regexp to validate an e-mail address, be sure that you actually use a correct regexp.
In particular, there are more valid punctuation characters than you may think. All of these
characters may appear to the left of the at-sign: ! # $ % & ' * + - / = ? ^ _ ` { | } ~
Don't believe me? Look at RFC 2822, which defines the current standard for e-mail addresses. ;)
There's no reason, other than laziness, to reject e-mail address that contain these characters
to the left of the at-sign. You might think that nobody uses these characters, but people who write
incorrect regexps are one reason why. Do your part to correct this situation. :)
Note in particular the plus sign. Many regexps reject addresses with the plus sign, but there are
e-mail addresses that have them. In particular, gmail has a special feature called "plus
addressing", so that if your username is "joeuser", you can use "joeuser+web at
gmail dot com" and "joeuser+business at gmail dot com" as separate addresses, and the
e-mail will be sorted depending on which address was used.
Even allowing all those punctuation characters isn't enough to fully satisfy RFC2822. For
example, you can use quoted strings to allow spaces in e-mail addresses, such as "joe
user" at somewhere dot com. But I wouldn't worry about such things too much, because
they're too obscure; just make sure you get all the punctuation characters in there.
----
Server IP: 216.194.113.175
Probable Submitter: 68.229.192.14
----
Manual Page -- http://www.php.net/manual/en/ref.mail.php
Edit -- https://master.php.net/note/edit/70912
Del: integrated -- https://master.php.net/note/delete/70912/integrated
Del: useless -- https://master.php.net/note/delete/70912/useless
Del: bad code -- https://master.php.net/note/delete/70912/bad+code
Del: spam -- https://master.php.net/note/delete/70912/spam
Del: non-english -- https://master.php.net/note/delete/70912/non-english
Del: in docs -- https://master.php.net/note/delete/70912/in+docs
Del: other reasons-- https://master.php.net/note/delete/70912
Reject -- https://master.php.net/note/reject/70912
Search -- https://master.php.net/manage/user-notes.php