Validate an email address in ColdFusion
To validate an email address in ColdFusion, we use the regular expression shown below.
You could easily add this to a CFC if you wanted to return a true or false depending whether the email address validates or not.
<cfset myEmail = "test@test.com">
<CFIF REFindNoCase("^[^@%*<> ]+@[^@%*<> ]{2,255}\.[^@%*<> ]{2,5}", trim(myEmail))>
Valid email address
<cfelse>
Oops, email address does not validate
</cfif>
