View Single Post
  #5 (permalink)  
Old 12-11-2007, 01:37 PM
mediakings mediakings is offline
Junior Member
 
Join Date: Aug 2007
Posts: 3
Default

I've found a solution.

Foreach mail i do something. If it's done i push to message number into an array.
After the foreach i remove the messages by reversing the values in the array en then delete them.

PHP Code:
foreach ($mail as $messageNum => $message) {
    
// do something
    
array_push($rm$messageNum);
}

if (
sizeof($rm) > 0) {
    
ZMailRemoveMessage($mail$rm);
}


function 
ZMailRemoveMessage(Zend_Mail_Storage_Abstract $storage$ids)
{
    
$ids = (array) $ids;

    if (
false === rsort($ids)) {
        throw new 
Exception('huh?');
    }

    while (
null !== $idx array_shift($ids)) {
        
$storage->removeMessage($idx);
    }

    return 
$storage;


Last edited by mediakings : 12-11-2007 at 01:40 PM.
Reply With Quote