Lasso Soft Inc. > Home

[email_check]

Linkemail_check
AuthorJason Huck
CategoryEmail
Version8.5.x
LicensePublic Domain
Posted02 Aug 2007
Updated02 Aug 2007
More by this author...

Description

Checks the specified POP account for messages. Optionally deletes the messages from the server. Returns an array of pairs. The key for each pair is the UID for the message and the value is the parsed message object.

Sample Usage

var('msgs') = email_check(
    -host='mailserver.tld',
    -username='jdoe@mailserver.tld',
    -password='secret',
    -delete=true
);

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.

define_tag(
	'check',
	-namespace='email_',
	-req='host', 
	-req='username', 
	-req='password',
	-opt='delete', -type='boolean',
	-priority='replace',
	-description='Checks the specified POP account for messages.'
);
	!local_defined('delete') ? local('delete') = false;
	
	local('pop') = email_pop(
		-host=#host,
		-username=#username,
		-password=#password
	);
	
	null(#pop->size); // workaround for bug in LP8.5.3b1
	
	local('msgs') = array;
	
	iterate(#pop, local('i'));
		#msgs->insert(#i = email_parse(#pop->retrieve));
		#delete ? #pop->delete(loop_count);
	/iterate;
	
	#pop->close;
	
	return(#msgs);
/define_tag;

Related Tags

Comments

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