House of Fusion
Home of the ColdFusion Community
Hostmysite Dedicated Hosting

Search nycfug

August 30, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
           1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31             

Subscribe Now
Fusion Authority Quarterly Update - ColdFusion 8 Special Edition

For ColdFusion hosting try HostMySite.com.
Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  New York ColdFusion Users Group (NYCFUG)

Server Sided Email Validation Routine?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Problem Summary:
Robert Harrison
12/29/05 10:18 A
> Dave Carabetta Wrote:
Robert Harrison
12/29/05 11:00 A

12/29/2005 10:18 AM
Author:
Robert Harrison

Problem Summary: User can enter email addresses to a data base through a form. Most are validated properly by java script on client side, but a few users don't have java script and they enter incorrect syntax in an email addresses. The bad email address goes into the data base and when a CFMAIL is processed against a query loop it chokes and hard fails on the first incorrect mail address format it encounters. Possible Solutions: I see a couple possible solutions: 1.  On an MX7 server I could use the new IsValid tag in the loop, however, the site is not on an MX7 server, it's on MX6. Bummer. 2.  If there was some way to make CFMAIL not choke on bad email addresses and just process through them that would be fine, but I can see no way to override the halt. 3.  If there was a script to validate on the server side I could use it. I found a custom tag an macro media site which does do server side validation for email at: http://www.macromedia.com/cfusion/exchange/index.cfm?view=sn131&extID=10 24332#loc=en_us&view=sn131&extID=1024332&viewName=ColdFusion%20Extension &avm=1 but the download gives a 404 error. HELP NEEDED: Bottom line is I need to either: 1) validate the format of an email address and, if it will not choke CFMAIL, let it run, or 2) tell CFMAIL not to halt and continue on when it gets a bad mail address. Does anyone know of a solution for this problem? Thanks, Robert B. Harrison Director of Interactive Services, Ext. 205 Linx Communications 155 East Main Street Smithtown, NY 11787 P (631) 361-4400 F (631) 361-6400 http://www.linx.com <http://www.linx.com/>;

12/29/2005 10:27 AM
Author:
Dave Carabetta

On 12/29/05, Robert Harrison <RobertH@linx.com> wrote: I use this e-mail validator method in our UDF CFC and it works great. Watch for wrapping: <cffunction name="isEmail" returntype="boolean" access="public" output="false" hint="I test passed value to see if it is a valid e-mail address (supports subdomain nesting and new top-level domains).">   <cfargument name="str" type="string" required="true" hint="I am the string to test." />      <cfscript>     var isOK = false;          //supports new top level tlds     if ( REFindNoCase("^['_a-z0-9-]+(\.['_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.(([a-z]{2, 3})|(aero|coop|info|museum|name))$", arguments.str) ) {       isOK = true;     }          return isOK;   </cfscript> </cffunction> Hope this helps. Regards, Dave.

12/29/2005 11:00 AM
Author:
Robert Harrison

> Dave Carabetta Wrote: <cffunction name="isEmail" returntype="boolean" access="public" output="false" hint="I test passed value to see if it is a valid e-mail address (supports subdomain nesting and new top-level domains).">   <cfargument name="str" type="string" required="true" hint="I am the string to test." />      <cfscript>     var isOK = false;          //supports new top level tlds     if ( REFindNoCase("^['_a-z0-9-]+(\.['_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\. (([a-z]{2,3})|(aero|coop|info|museum|name))$", arguments.str) ) {       isOK = true;     }          return isOK;   </cfscript> </cffunction> Yup. That works great. Thank you. Robert B. Harrison Director of Interactive Services, Ext. 205 155 East Main Street Smithtown, NY 11787 P (631) 361-4400 F (631) 361-6400 http://www.linx.com

12/29/2005 12:08 PM
Author:
Dave Carabetta

On 12/29/05, Robert Harrison <RobertH@linx.com> wrote: Not a problem. Glad it helped! Regards, Dave.


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists