Lasso Soft Inc. > Home

[ email_compose->addattachment ]


[email_compose->addAttachment] adds a new attachment to a message being composed. The tag requires either both the -data and -name parameters or the -path parameter.

The -data parameter should specify the data of the file to be attached. This data will be automatically Base64 encoded before being placed in the message. The -name parameter specifies the name for the attached file.

Instead the -path parameter can be used to specify the location of a file that will be included as the attachment. If the -path parameter is specified then the name will be automatically set to the name of the file.

  • Syntax
email_compose->addAttachment(-data='data', -name='attached.txt')

  • Beginner

Attaching the same picture twice

The code below will attach the same picture in two different way. The email that it produces will have the picture attached twice.


var(my_msg) = email_compose(-to='', -from='', -subject='Find Me')
$my_msg->addTextPart(-data='# Lost Rhino!')
$my_msg->addAttachment(-data=include_raw('/img/poster.png'), -name='poster1.png')

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home



©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft