PHP (no multi-thread as Java)
CLI Mode:
task.php
getLock();
$markedPosition = getLastMarkedEmail();// may be offset
while (true) {
$arrEmail = getEmailList($markedPosition);
if (empty($arrEmail)) {
break;
}else {
// do sth with "small" email list
$markedPosition = setLastMarkedEmail();
}
}
echo 'Done';
releaseLock();
CGI Mode:
task.php
Method 1: task.php?offset=0 -> redirect -> task.php?offset=O1 -> .... (meta refresh tag)
Method 2: while(true) {result = sendAjaxRequest(); if (result == false) break;}
Call to other API (alreay support send bulk email list - code written in Java, C, Ruby, or Python... :p):
task.php
$arrData = array(
array('from' => $sender, 'to' => $receiver, 'subject' => $subject, 'content' => $content, 'files' => $attachFiles),
//... N other elements
);
$client = new APIConsumer();
$result = $client->sendBulkEmailList($arrData);
Title:
send bulk email list
Description:
PHP (no multi-thread as Java) CLI Mode: task.php getLock(); $markedPosition = getLastMarkedEmail();// may be offset while (true) { $...
...
Rating:
4