IMAP 函数
在线手册:中文 英文
PHP手册

imap_expunge

(PHP 4, PHP 5)

imap_expungeDelete all messages marked for deletion

说明

bool imap_expunge ( resource $imap_stream )

Deletes all the messages marked for deletion by imap_delete(), imap_mail_move(), or imap_setflag_full().

参数

imap_stream

imap_open() 返回的 IMAP 流。

返回值

Returns TRUE.


IMAP 函数
在线手册:中文 英文
PHP手册
PHP手册 - N: Delete all messages marked for deletion

用户评论:

boswachter at xs4all dot nl (12-Jan-2006 03:57)

@eisbrenner at gidn dot de

You shouldn't call imap_expunge until before closing the connection. imap_delete tags a message for deletion, imap_expunge deletes all tagged messages. i.e.:
for ($i = 0; $i < $num; $i++) {
  imap_delete($box, $i);
}
imap_expunge($box);

imap_expunge should not be in your inner loop.