On 2/6/11 4:19 PM, terry peng wrote: > Have you set the "Disposition" option to "attachment" rather than the default > "inline"?
No, I hadn't. Thanks, I missed that option. However, even with the option set for the attachment, the contents of the CSV file still appear in email, at least for my Thunderbird client, because I had "Display Attachments Inline" checked. I've pasted the current headers below. If possible I would like to avoid making assumptions about the configuration of users' mail clients. How to force the display so that an attachment always appears as an attachment? thanks dn Mail headers with CSV file disposition set to 'attachment': This is a multi-part message in MIME format. --_----------=_1297044547631150 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain Here's the GIF file you wanted --_----------=_1297044547631150 Content-Disposition: attachment; filename="filename.csv" Content-Transfer-Encoding: 8bit Content-Type: text/csv; name="filename.csv" > Regards. > > > Sun, 06 Feb 2011 15:38:44 -0800 письмо от David Newman > <dnew...@networktest.com>: > >> Greetings. I'm looking for a way to run a query against a SQL database, >> save the result into a file, and then attach the file to an email. >> >> The DBD::mysql and MIME::Lite modules handle the SQL query and email >> attachment respectively, but at least with the MIME 'text/csv' format >> there's a problem: In Thunderbird and Outlook, the attached file appears >> embedded in the message body. Here's an example in Thunderbird: >> >> ----- >> >> Here's the data you requested. >> >> >> somefile.csv >> >> id,date_created,date_updated,ip_address,firstname,lastname,title,organization,email,country >> 1,2010-05-13 07:48:18,,1.2.3.4,Homer,Simpson,Safety Dept.,Burns Nuclear >> Energy,chunkylove...@aol.com,USA >> 2,2010-05-13 09:22:05,,5.6.7.8,Hank,Hill,Propane Specialist,Strickland >> Propane,,USofFrickinA >> ... >> >> ----- >> >> Having the CSV output appear in the message body is a problem for the >> nontechnical audience that will receive this message. >> >> Is there a module that will put the query output in native Excel format, >> or a MIME format that will attach the CSV file so that its contents do >> not appear in the message body (i.e., it just shows up as an attached file)? >> >> thanks >> >> dn >> >> >> -- >> To unsubscribe, e-mail: beginners-unsubscr...@perl.org >> For additional commands, e-mail: beginners-h...@perl.org >> http://learn.perl.org/ > > -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/