Solved

Add button to cfmail

Posted on 2006-10-19
3
292 Views
Last Modified: 2013-12-24
Hi, I have an html table in cfmail but wanted to know if there is any way to add a button so that when the email gets sent, my users can click on the button and it would copy the table, then paste that table in an excel spreadsheet.  Can cfm or javascript do this or would it depend on the user's email client to allow for that?
0
Comment
Question by:COwebmaster
3 Comments
 
LVL 36

Expert Comment

by:SidFishes
ID: 17769937
pretty sure that kind of active content in an email would be prevented by most eClients. The interactive between the desktop on the email required would be  risky to allow.

(of course you could always get all of your user to switch to outlook express circa 1991. I'm sure this would be easy using that :)

0
 
LVL 3

Accepted Solution

by:
bhinshawnc1 earned 500 total points
ID: 17770931
Have a similar scenario where we email a form via outlook and when they click on the button in the email it sends info from the email form back to the server.

I would send them the button via email and when they click on, have it connect to your server, get the table and send those results out to an excel sheet.

Sample message to them:

<CFMAIL
spoolenable="no"
TO="#a#"
FROM="#b#"
SUBJECT="x"
TYPE="HTML">
<FORM NAME="email_form" ACTION="http://#your_server#/get_table.cfm" METHOD="post" onSubmit="return submitForm();">
 
<!--- use hidden fields to pass things back to the server --->
  <input type="hidden" name="sales_contact" value="#qry_project.a#">
  <input type="hidden" name="project_id" value="#qry_project.b#">
  <input type="hidden" name="pri_eng" value="#qry_project.c#">
  <table>
 
  <tr>
  <td colspan="2" align="center">
  <input type="hidden" name="submitform" value="">
 <input type="submit" name="Submit" value="submit" onClick="document.email_form.submitform.value = 'submit';">
  </td>
  </tr>
 
</table>

</FORM>

Then when they come to the page they get a message letting them know they will soon get a prompt for open or saving an excel file, they should save the file

then in that page use

<cfcontent type="application/msexcel">
         <cfheader name="Content-Disposition" value="filename=get_table.xls">

and whatever you have in a <cfoutput> after that would be sent to excel


</CFMAIL>
0
 

Author Comment

by:COwebmaster
ID: 17771277
Thanks, I'll try it out.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
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.

760 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

18 Experts available now in Live!

Get 1:1 Help Now