1 2 3 4 5 6 7 8 9 10 11 12 |
Place this at the end of your file, after you have processed any emails, this will move all found in the inbox, and move them to a folder called 'done'. $countnum = imap_num_msg($mbox); if($countnum > 0) { //move the email to our saved folder $imapresult=imap_mail_move($mbox,'1:'.$countnum,'done'); if($imapresult==false){die(imap_last_error());} imap_close($mbox,CL_EXPUNGE); } |
This wont work if you have read only on your connection (this doesn’t).