[email_check]

Description

Link: [email_check]
Author: Jason Huck
Category: Email
Version: 8.5.x
License: Public Domain
Posted: Aug. 02, 2007
Updated: Jan. 01, 0001
More by this author...
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.

Parameters

-host string, required The email server to check.
-username string, required The username for the mailbox to check.
-password string, required The password for the mailbox to check.
-delete boolean, optional Whether to delete messages from the server. Defaults to false.

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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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

none

Email:


Password:



Newest

Most Popular