View Full Version : Attaching CSV file
21-Jun-2004, 02:24 PM
Is it possible, when you create a csv file from the contents of a submitted form, to attach that csv file to the e-mail sent to the address defined in your script and then delete the csv file.
ie. I only want the data form 1 form at a time to be in the csv file and for the file to be attached to the e-mail that I receive.
Please can you let me know if this is possible.
21-Jun-2004, 07:40 PM
No there's no way to do this in the current version.
The best way is to create an HTML template that looks like a CSV file and use that to send you the email.
Depending on your email program, you could save that "HTML" version of the data or just copy-and-paste.
22-Jun-2004, 09:45 AM
thanks for that, but unfortunately the HTML e-mail or copy & paste is not anoption as I need to be able to use the csv file in a VB application once it has been downloaded.
22-Jun-2004, 12:55 PM
If you can use a workaround for a while, I've put this request into our To Do list for FormMail.
It won't happen for a number of weeks, but it will happen.
22-Jun-2004, 03:21 PM
Thanks Russell, Very much appreciated.
01-Jun-2005, 11:12 PM
First, I want to thank you for creating and *supporting* a great script!
Second, I was wondering if the change in this thread (mentioned back in June 2004) was ever implemented into formmail? If so, are there instructions on how to set it up?
Specifically, I need to use the csv in a script (similar to eu4ic's request). It would be best if the form could attach and send a new csv file via e-mail each time, but if not at least overwrite the data in the csv file rather than appending it.
Please let me know.
Thanks so much,
01-Jun-2005, 11:58 PM
You use a PlainTemplate and attach it by using the new "null" filter.
Once you have the PlainTemplate working (check out the how-to guides), you can attach it instead of have it in the body of the email with the following hidden fields:
<input type="hidden" name="filter" value="null" />
<input type="hidden" name="filter_options" value="Attach=data.csv" />
When you upgrade you may need to manually re-create the "null" filter because the Upgrade Wizard will simply replace the new $FILTERS with the old $FILTERS:
$FILTERS = array("encode"=>"$REAL_DOCUMENT_ROOT/cgi-bin/fmencoder -kpubkey.txt",
Powered by vBulletin® Version 4.1.4 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.