1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23:
This would be the contents of SendEmail.cfm <cfset form.email = trim(form.email)> <cfif len(form.email) eq 0 or form.email is "Your Email"> <cfthrow message="Please enter your email address"> <cfelseif listLen(form.email,"@") neq 2 or listLen(listLast(form.email,"@"),".") eq 0> <cfthrow message="Invalid Email address"> </cfif> <CFQUERY NAME="GetEmail" dataSource = "#application.datasource#"> SELECT Email FROM SubscriberTestEmailGroup WHERE email = <CFQUERYPARAM VALUE="#FORM.EMAIL#" CFSQLTYPE="CF_SQL_VARCHAR"> </CFQUERY> <cfif GetEmail.recordcount gte 1> <cfthrow message="That email is already registered to receive the newsletter"> </cfif> <cfquery dataSource = "#application.datasource#"> insert into SubscriberTestEmailGroup (email) values ('#form.email#') </cfquery>