php-imap
php-imap copied to clipboard
What is the fastest way to get one message?
My code:
return $folder->query()->all()->limit(1)->get()->last();
I am currently processing emails from a mailbox with about 9 thousand messages. Connection via oAuth, The above code executes in about 1.6 seconds. Is it possible to download one message faster? It does not matter to me whether it will be the first, last or random message from the mailbox.