I'm trying to use ColdFusion to send out emails containing attachments stored on our server.
To manage these attachments we call them 1.jpg
, 2.doc
... n.ext
where n
is a key in a database where we hold other information about the file such as its original filename.
I can use the code:
<cfmailparam file="c:\path\1.doc">
to specify the file, but it is then attached to the email as 1.doc
. Is there anyway I can override this and specify my own filename separately from the file?
You can try adding:
<cfmailparam
file="#actual_file_name#"
disposition="attachment; filename=""#changed_file_name#""">
The multiple quotes are deliberate... I they allow spaces in the file name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With