Solved

CFform and CFMail

Posted on 2002-07-29
8
344 Views
Last Modified: 2013-12-24
I would like to include CFFORM tags within CFMAIL tags.  When the mail recipient receives the email he is asked to complete a small form and submit. These 3 fields populate a table in a database.

Is this possible? My code is as follows:


<CFMAIL TO="xxx"  
     FROM="yyy"
     SUBJECT="zzz
        type="HTML"
        server=?????>

<CFFORM  NAME="FORM" ACTION="email_response.cfm" METHOD="POST" >
     <TABLE>
     <TR><TD>Email Address&nbsp;&nbsp;&nbsp;<INPUT TYPE="text" NAME="EMAIL_ADDR" SIZE=20></TD>
     <TD>Yes&nbsp;&nbsp;&nbsp;<CFINPUT TYPE="Radio"  VALUE="Yes" NAME="DECISION"></TD>
     <TD>No&nbsp;&nbsp;&nbsp;<CFINPUT TYPE="Radio"  VALUE="No" NAME="DECISION"></TD>
     <TD><INPUT TYPE="hidden" NAME="INVOICE_NBR" VALUE=#Form.INVOICE_NBR#  SIZE=20></TD>
     
     </TR>
     <TR>
     <TD><INPUT TYPE="Image"  SRC="travel/images/submit.gif"  NAME="Submit"  ALIGN="right" BORDER="0"></TD>
     </TR>
     </TABLE>
</CFFORM>
</CFMAIL>



email_response.cfm:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<HTML>
<HEAD>
     <TITLE>Travel Application Approval Submittal</TITLE>
</HEAD>

<BODY>

 
<CFQUERY NAME="QAPPROVALS" DATASOURCE="#db#" >
INSERT into TBL_APPROVALS
VALUES('#Form.INVOICE_NBR#','#Form.EMAIL_ADDR#','#Form.DECISION#')

</CFQUERY>



</BODY>
</HTML>
0
Comment
Question by:CTerreri
8 Comments
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7185994
Not sure if that'll work.  Have you tried it yet and if so what happens?  Also what errors do you get?
0
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7186003
Also you might  not want it done like this becasue not all email boxes will show HTML in the preview window.  Also alot of users have this feature disabled.  I would put a link on the email to the form running on your server and handle it that way.  Of course your idea would be cool but not very practical  I think.
0
 
LVL 17

Accepted Solution

by:
anandkp earned 300 total points
ID: 7187162
HI there,

Yes what ur trying to do is definately possible.

but u got to keep one thing in mind - before going ahead with this. [All ur mail recipients should be able to recieve HTML mails.]

if u r sure abt this ... go ahead with this - it shoudnt be a problem - as ive myself done this many a times ...

so be cool !!!

K'Rgds
Anand
0
Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
LVL 5

Expert Comment

by:CFXPERT
ID: 7192395
Exactly my comment above.  I respectively offer my suggestions as an answer to your question.

KWK
0
 
LVL 5

Expert Comment

by:CFXPERT
ID: 7247499
Hi CTerreri

Any luck here on this?
0
 

Author Comment

by:CTerreri
ID: 8092223
I know its been a while since this question was last addressed but I would like to reopen if anyone's interested.

My latest input on this is that I tried to implement the cfform tag within cfmail but when I hit submit ...nothing happens.  The email is no longer generated once I add the cfform code in.

Can anyone explain why this is happening?

P.S.  Please note the increase in points.
0
 
LVL 10

Expert Comment

by:substand
ID: 9134915
do you still need help on this?
0
 

Author Comment

by:CTerreri
ID: 9141224
It took me a long time to get this to work but it finally did.  I had some html problems that I had to resolve before I could get this to work.

Thanks to all
0

Featured Post

Don't miss ATEN at NAB Show April 24-27!

Visit ATEN at NAB Show to learn how our "Seamlessly Entertaining" solutions deliver fast, precise video streaming without delays for the broadcasting and media environment. ATEN will showcase its 16x16 Modular Matrix Switch (VM1600) and KVM Over IP Solution (KE6900 series).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Troubleshoot mediawiki <-> ActiveDirectory authentication 2 140
Use System DSN 6 91
Autoresponder for Whole Domain in Plesk/Cpanel 2 95
AWS New EC2 Instance and EBS Storage 2 96
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
What You Need to Know when Searching for a Webhost Provider
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question