我正在使用 ColdFusion 文件,当用户从系统导出数据时,该文件将发送带有附件的电子邮件。目前,附件是 .txt 格式,难以解释,因此毫无帮助。我试图弄清楚如何更改此设置,以便电子邮件中发送的附件为 .csv 格式。这是我认为需要更改的代码部分:
<cfset FileName = "#request.uncPath#\IncidentSummarySystem\data\" & #variable.UserName# & "-" &#DateFormat(now(), "ddmmyyyy")# & "-" & #TimeFormat(now(), "HHmmss")# & ".txt"> <cffile action="Write" file=#FileName# output="#FileData#">
<cfmail to="#rsUsers.qryUserEmail#" from="IncidentSummarySystem@" subject="Incident Summary System Export File" mimeattach="#FileName#">
DO NOT REPLY TO THIS E-MAIL.
Incident Summary System: Your report is attached as a text (.txt) file.
</cfmail>
<script language="JavaScript">
window.alert ("The information you have requested will be sent to you via e-mail.");
</script>
<cffile action="Delete" file="#FileName#">
是否可以将附件文件类型更改为 .csv,我将如何执行此操作?