Open quangvi282 opened 6 years ago
Can you please share your full error?
Having the same problem.
It's related to what's in the docs in here (http://ssilence.github.io/php-imap-client/usage.html), in the line below:
$imap->deleteMessage($emails[1]['id']);
The problem is that when we retrieve a message, for example using the getUnreadMessages method, it returns an array of SSilence\ImapClient\IncomingMessage, but the id property of this object is private, so we can't use it as and array, like the docs say, and can't use it as a property, 'cause it's private.
Just a getter would solve this problem.
For those who won't change the code and need it for now, could use the code below:
$ref = new ReflectionClass(get_class($email));
$prop_id = $ref->getProperty('id');
$prop_id->setAccessible(true);
$id = $prop_id->getValue($email);
Not the prettiest way, but solves the case where you don't want to change the source for an implementation or wait for the solution.
when i getmessages, it return this error ( emails[0]['id'] not valid)