Solved

CFform and CFMail

Posted on 2002-07-29
8
339 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 5

Expert Comment

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

KWK
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 5

Expert Comment

by:CFXPERT
Comment Utility
Hi CTerreri

Any luck here on this?
0
 

Author Comment

by:CTerreri
Comment Utility
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
Comment Utility
do you still need help on this?
0
 

Author Comment

by:CTerreri
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now