I have a script which does
for (i =..... {
if (I want to delete this email) {
imap_delete( $msg, $i );
}
}
I have no problems with all the other parts of code (not shown) - i.e., examine subject, sender, body, etc.
But I get problems, because when I mark for deletion, the order seems to screw up - some emails get missed out, and blank ones 'created'. I am not even deleting, just marking for deletion, so I don't understand what is happening. It is as though the value of $i changes (it doesn't) or the message list gets re-ordered.
Has anyone worked with imap_delete?