I am using ColdFusion to build a CSV file and then sending it as an email attachment to a user.
I copy myself on the emails, receive the attachment as a CSV file, in both Gmail and Outlook, and can open the attachment as a CSV file in Microsoft Excel.
I am attaching the file using the CFMAILPARAM
tag. I have tried sending it two ways:
<cfmailparam file="C:/temp/myfile.csv" type="text/plain" />
This results in the user seeing a .txt
file. When I receive the email, the Header reads:
Content-Type: text/plain
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename*=myfile.csv
Using:
<cfmailparam file="C:/temp/myfile.csv" type="text/csv" />
This results in the user seeing a .dat
file, which they cannot open in Microsoft Excel. When I receive the email, the Header reads:
Content-Type: text/csv
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename*=myfile.csv
Any idea what's going on here?