-
-
Notifications
You must be signed in to change notification settings - Fork 182
Description
I have a problem or doubt more than anything else, I am occupying the overview method because I want to make the search list me even if it is from a UID onwards, the issue that I know that a mail has as UID 165 -168 to 185 but when I put the range brings me null and if I list from 1:* brings me all but I would like to start from a specific sequence and not from the beginning.
This is the code that I am occupying.
$cm = new ClientManager([
'options' => [
'fetch' => \Webklex\PHPIMAP\IMAP::FT_PEEK,
'fetch_order' => 'desc',
'sequence' => \Webklex\PHPIMAP\IMAP::FT_UID,
],
]);
$oClient = $cm->make([
'host' => 'imap.gmail.com',
'port' => 993,
'protocol' => 'imap',
'encryption' => 'ssl',
'validate_cert' => true,
'username' => 'jer******@gmail.com',
'password' => '*****',
]);
$oClient->connect();
$folder = $oClient->getFolder('INBOX');
$message = $folder->overview($range = "1:*");//Working ✔
//$message = $folder->overview($range = "168:*");//Not working ❌
foreach ($message as $key => $value) {
dd($folder->query()->getMessageByUid($key));
}
If I occupy $folder->overview('1:*'); it brings me this
But if I occupy $folder->overview('168:*'); it brings me null
Because the idea of this method would be to bring a quick description between 2 ranges, but I don't know if the sequence works by UID search or by a number as it is in the mail
Here I made the query $folder->query()->getMessage(165) ; to check if this UID exists so the overview method should work too and not bring me null.