Solved

Add button to cfmail

Posted on 2006-10-19
3
330 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

829 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