note 60418 added to function.imap-expunge

From: Date: Fri, 06 Jan 2006 10:56:16 +0000
Subject: note 60418 added to function.imap-expunge
Groups: php.notes 
Request: Send a blank email to php-notes+get-101300@lists.php.net to get a copy of this message
Be careful using this function with a pop3 server, if you have an array of mails you want to handle in a loop. If you want wo handle the mailcontent to use it in your application and use i.e. $messages = imap_sort($connection, SORTARRIVAL, FALSE); and have an loop like foreach($messages as $i) { // do something with the content imap_delete($i); imap_expunge($connection); } every 2nd mail will be left untouched. the first will be read, deleted, the second becomes #1, but due to the loop-condition #2, which was #3 as you started, will be left and #4 - which is #3 now, will be read instead. the pop3-protocol has no expunge-method, so i assume they disconnect to delete the flagges mails and reconnect. :-(( So you have to you the number 1 for all .... ---- Manual Page -- http://www.php.net/manual/en/function.imap-expunge.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+60418 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60418&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60418&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60418&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60418&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60418&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60418&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60418&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+60418&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#101300) next »