Link | email_attachments |
Author | Jason Huck |
Category | |
Version | 8.5.x |
License | Public Domain |
Posted | 02 Aug 2007 |
Updated | 02 Aug 2007 |
More by this author... |
Returns an array of email attachment data for the given message. Follows the example from the Language Guide with the addition of also including message parts with a content-disposition of "inline." Each item in the array is a map containing the raw message data, the filename, the file's MIME type, and the size.
var('attachments') = email_attachments($mymsg);
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
define_tag( 'attachments', -namespace='email_', -req='in', -copy, -priority='replace', -description='Returns an array of email attachment data for the given message.' ); protect; #in = email_parse(#in); /protect; local('out') = array; iterate(#in, local('i')); if(#i->content_disposition >> 'attachment' || #i->content_disposition >> 'inline'); local('item') = map; #item->insert('data' = #i->body); #item->insert('name' = #i->content_type('name')); #item->insert('type' = #i->content_type->split(';')->first); #item->insert('size' = #i->body->size); #out->insert(#item); /if; /iterate; return(#out); /define_tag;
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft