How to mail attachment using the mail syntax?

Looking to add an attachment using this method:

How is that accomplished?

   subject="Example Attachment">
   blah.. blah..
   <cfmailparam file="c:\fubar\">
   <cfmailparam file="c:\fubar\photo.gif">

If you get a chance, updating the Lucee docs would be great :slight_smile:

Iā€™d love to see the cfscript syntax. Is that available anywhere?

// Create an instance of the mail object
mail=new mail();

// Set it's properties
mail.setSubject( "Sample Email" );
mail.setTo( "" );
mail.setFrom( "" );
mail.setCC( "" );
mail.setBCC( "" );

// Add an attachment
mail.addParam( file="C:\foo.txt" );

// Add email body content in text and HTML formats
mail.addPart( type="text", charset="utf-8", wraptext="72", body="This is a test message." );
mail.addPart( type="html", charset="utf-8", body="<p>This is a test message.</p>" );

// Send the email

h/t via