EasyCFM.COM ColdFusion Forums / Good Coding Tips! / Email Checking, Hope you Like It

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Email Checking, Hope you Like It

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

specific
04-05-2007 @ 6:30 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 897
Joined: Apr 2006

Hey I have many websites forums where i say one major problem across as how to get the multiple emails checking and that should be valid also. It is a Server side script and in coldfusion, if you like it plz dropa word of it..

here is the script:

<cfset MultipleFields = form.email_cc>
     <cfif REFind("[,;]",MultipleFields) gt 0>
          <cfloop list="#MultipleFields#" delimiters=",;" index="idx">
               <cfif ReFind("[a-zA-Z0-9_-]+@[a-zA-Z0-9\.\-]+\.[a-zA-Z]+",idx) lt 1>
                    <h3>The Email you Entered Is Invalid In the Textarea Box, <br />
                    Use , or ; to Sepate Email Addresses</h3>
                    <a href="javascript:history.back(-1);">Go Back & Correct Problem</a>
                    <cfabort>
               </cfif>
          </cfloop>     
     <cfset MultipleFields = Replace(ToField,";",",","ALL")>
     <cfelse>
     <cfif ReFind("[a-zA-Z0-9_-]+@[a-zA-Z0-9\.\-]+\.[a-zA-Z]+",MultipleFields) lt 1>
          <h3>The Email you Entered Is Invalid In the Textarea Box, <br />
                    Use , or ; to Sepate Email Addresses</h3>
               <a href="javascript:history.back(-1);">Go Back & Correct Problem</a>
          <cfabort>
     </cfif>
</cfif>     

well like in a textarea where user enters multiple email address and we need a valid check for this, this is the code for that.

let's see what you say.

Thanks for this Forums

<hr><br>
The Door to Coldfusion Community Will Remain Open Till World Ends

Want a Web Portal Contact Me

randhawaz81@gmail.com

This message was edited by specific on 4-5-07 @ 6:31 AM


Website Designed and Developed by Pablo Varando.