How Can I Use OnClick To Fire <CFMAIL> Email Message In Background

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

How Can I Use OnClick To Fire <CFMAIL> Email Message In Background

This post has NOT been accepted by the mailing list yet.
I am attempting to have an email alert ( via <CFMAIL> ) sent to me in the background (not visible to the user) whenever a user downloads a document from my webpage.  I have tried the following using an onClick event handler.  The code doesn't barf at all, and the document downloads fine, but the email message doesn't get fired.  It should be a relatively simple thing to do, but I am still pretty much a novice at this and may be missing something really obvious.  I would really appreciate any help.  Thanks!

This is the code I am trying to use to call the template as the user clicks to download the document:

<a href="doc_directory/doc_file.pdf" onClick="doc_download_alert.cfm";>Click here to download

This is the code for the called template that is supposed to fire off the <CFMAIL> message in the background:

<!doctype html public "-//W3C//dtd html 3.2 Final//EN">

<cfprocessingdirective suppresswhitespace="no">
from="my website"
subject="download alert">
<p>ALERT: document downloaded from my page