So I've recently started my first real job (yay!) and I'm working on an email checker.
It's working great, no errors... provided there are emails.
$mbox = imap_open("{.../pop3/novalidate-cert}INBOX","smith@example.com","...");
$inbox = imap_check($mbox);
The above code works just fine when there are emails in the inbox, but if there aren't I get this error at the end of the page:
Notice: Unknown: Mailbox is empty (errflg=1) in Unknown on line 0
No amount of error suppression seems to be able to stop this from being thrown, other than error_reporting(E_ALL^E_NOTICE)
, which I'd rather not use (for once!)
Can anything be done?