Andy Matthews wrote:
> CFMAIL is a form handler, but it does require a moderate amount of coding to
> send the values of specific form fields to the recipient. What I'm talking
> about is something that you could use as a processing page for ANY form you
> create. You'd never need to touch the processing script at all, just set up
> the form and point it at the handler.
Hi Andy
I may be misunderstanding something here, so correct me if I'm wrong,
but can't you just loop over the form collection inside cfmail? As far
as the cfmail variables go, I usually have a globals file and set my
email variables in that:
<cfset server_mail = "[EMAIL PROTECTED]" />
<cfset admin_mail = "[EMAIL PROTECTED]" />
<cfset webmaster_mail = "[EMAIL PROTECTED]" />
When you want to process a form that requires mailing, attach the
subject to the form submission url...
<form method="post" action="processForm.cfm?subject=Form Subject">
or if you're using a framework this can obviously be done elsewhere
(if it's fusebox, inside the fuseaction, for instance).
Then the following should be able to hand most email submissions without
the need for hardcoding.
<cfmail from="#server_mail#" to="#admin_mail#" subject="#subject#">
<cfloop item="formfield" collection="#form#">
<cfif formfield NEQ "fieldnames" AND Trim(Len(formfield))>
#formfield# : #form[formfield]#
</cfif>
</cfloop>
</cfmail>
Code not tested but this should give you the general idea.
HTH
Adieu
Mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:239727
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