note 60418 deleted from function.imap-expunge by didou
| From: | didou@php.net | Date: | Mon, 15 Jan 2007 00:51:47 +0000 |
| Subject: | note 60418 deleted from function.imap-expunge by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-121714@lists.php.net to get a copy of this message | ||
Note Submitter: eisbrenner at gidn dot de
----
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 ....