When calling imap_close($mbox), notices will be generated for each error that has occurred within the imap functions. To suppress these error messages (including Mailbox is empty, which is not really an error) simply call imap_errors() and then imap_close($mbox).
imap_errors
(PHP 4, PHP 5)
imap_errors — 発生したすべての IMAP エラーを返す
説明
array imap_errors
( void
)
ページのリクエストの間かエラースタックがリセットされて以来 生じた全ての IMAP エラー (存在すれば) を返します。
imap_errors() がコールされると、 処理の終了後にエラースタックがクリアされます。
返り値
この関数は、最後に imap_errors()
コールを行ってから、またはそのページの処理を開始してから
発生した全ての IMAP エラーメッセージの配列を返します。
エラーメッセージが存在しない場合には FALSE を返します。
Jeremy Glover ¶
6 years ago
