Webklex / laravel-imap

Laravel IMAP is an easy way to integrate both the native php-imap module and an extended custom imap protocol into your Laravel app.
https://www.php-imap.com
MIT License
637 stars 181 forks source link

Thread mesage #406

Closed hopdt1404 closed 2 years ago

hopdt1404 commented 3 years ago

Describe the bug

I have problem when get thread message. After I get a message successful by sequence or uid, I want result is thread mail (example [subject] - Re: [subject])

I used $mail->thread(); or $mail->thread($folder); but error: is Error: Call to a member function query() on null in file vendor\webklex\php-imap\src\Message.php on line 822

function Message@thread has 3 parameters and those can be null

Desktop / Server (please complete the following information):

OS: Window PHP: 8.0.7 Laravel Framework: "^8.40"

=> How to get thread message when after got message information from mail server? Thanks for red this issue

Webklex commented 2 years ago

Hi @hopdt1404 , many thanks for your report. Can you please provide some code samples? I'm having a hard time replicating this issue.

Which version of "webklex/php-imap" do you use? If you are unsure, please check the composer.lock file and search for webklex/php-imap.

Best regards,

stanfortonski commented 2 years ago

I had same problem. That didn't work probably because folder doesn't exists. Lines below works for me. So basically you have to set folders.

//Set client and connection stuff...
$currentThread = null;
$messages = $message->thread($client->getFolder('Sent Mail'), $currentThread, $client->getFolder('INBOX'));