Lasso Soft Inc. > Home


AuthorJason Huck
LicensePublic Domain
Posted02 Aug 2007
Updated02 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.

Sample Usage

var('attachments') = email_attachments($mymsg);

Source Code

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.

	-req='in', -copy,
	-description='Returns an array of email attachment data for the given message.'
		#in = email_parse(#in);
	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);


Related Tags


No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home



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