Search code examples
emailcoldfusionoutlookcoldfusion-11cfmail

cfmailparam disposition filename does not work in outlook


I have a very simple example for sending an image as an attachment using Coldfusion 11 cfmail tag.

<cfmail to="[email protected]" from="[email protected]" subject="Test" type="html">
<cfmailparam
file="www.example.com/image.png"
disposition="attachment; filename=""test.png""">
</cfmail>

I want the attachment to be called "test.png" when it is viewed in the recipients email client.

It works fine when I receive the email in Gmail, however Outlook 2013 (and Office 365 web client) retains the "image.png" attachment name.

Have I correctly made use of the "disposition" attribute?


Solution

  • If disposition is not working for you, try combining file and content instead.

    <cfmailparam
        file="test.png"
        content="#fileRead( 'image.png' )#" >
    

    More details here.