barbushin / php-imap

Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)
MIT License
1.65k stars 459 forks source link

PHP Fatal error: Uncaught Error: Call to protected method PhpImap\Mailbox::disconnect() #702

Open SalimF opened 1 year ago

SalimF commented 1 year ago

Environment (please complete the following information):

Your Text I install the library using compser composer require php-imap/php-imap

and then I downloaded the file get_and_parse_unseen_emails.php I only changed this line to point correctly to the autoloader

require_once __DIR__.'/vendor/autoload.php'; and I added the correct credentials from my yahoo account (I used thunderbird settings). but is still won't work

I was able to get the messages but, looks like the example I used do not work if there is no unread emails or there is no attachment.

But the final error I got I think it should not happen related to method PhpImap\Mailbox::disconnect() , should I not use this method if implement it on my projects?

PHP Fatal error:  Uncaught Error: Call to protected method PhpImap\Mailbox::disconnect() from context '' in /run/media/pc/hdd/www/win10-bots/src/mail/unseen_emails.php:73
Stack trace:
#0 {main}
  thrown in /run/media/pc/hdd/www/win10-bots/src/mail/unseen_emails.php on line 73

PHP Fatal error:  Uncaught Error: Call to protected method PhpImap\Mailbox::disconnect() from context '' in /run/media/pc/4962-FE80/www/win10-bots/src/mail/unseen_emails.php:69
Stack trace:
#0 {main}
  thrown in /run/media/pc/hdd/www/win10-bots/src/mail/unseen_emails.php on line 69