It's actually fiendishly difficult to write a regex, or even a set of 
regexes to fully validate the syntax of an email address.

Once you've done that you still have the problem of people entering 
emails like [EMAIL PROTECTED] which is almost certainly not their own.

The most reliable approach is usually to send an email that requires the 
recipient to take some action to verify that they received the message.

Beyond that, I typically use a very simple regex something like 
"[EMAIL PROTECTED]" to validate that the basic syntax could be an email address.

Spike

Ken Ketsdever wrote:
>  
> I am writing an application that will be used to send 25,000 or so e-mails 
> once a month.  I am also trying to define a valid e-mail address to keep the 
> db clean by preventing people from enter invalid email addresses.   I've 
> tried reading rfc822 and 2822.  Can't say it helped much.  RFCs are  level of 
> geekdom that I've yet to achieve.  
>  
> Does anyone know of a good source for identifying the rules for a valid email 
> address?
>  
> Some of the problems I am up against:
>  
> I know and underscore can be used in the first section of an email address.
> FirstName_LastName@
>  
>  
> But can it be the first or last character?
> _FirstName_Lastname@
> or
> FirstName_LastName_@
>  
> The RegEx I am using doesn't allow the first or last charcter to be an 
> underscore.
> It also prevents nonAlpha-numeric characters from being together.
>  
> so Ken_.ketsdever@  is invalid per the regex.
>  
> Any and all help is appreciated. 
>  
>  
>  
> Ken Ketsdever
> Web Developer
> www.BloodSource.org <http://www.bloodsource.org/> 
> (916) 453-3718
>  
> 
> Confidentiality Notice:  This message including any
> attachments is for the sole use of the intended
> recipient(s) and may contain confidential and privileged
> information. Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the
> intended recipient, please contact the sender and
> delete any copies of this message. 
> 
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:186388
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to