Solved

Add button to cfmail

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Forbidden errors 5 144
.htaccess rewrite url with querystring problem 13 96
How to move and access a folder outside of the root folder 4 88
Two wordpress questions 3 46
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…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 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