laravel-imap icon indicating copy to clipboard operation
laravel-imap copied to clipboard

$message = $folder->query()->get()->first(); returning null

Open makedreams45 opened this issue 3 years ago • 2 comments

I am integrating Webklex for receiving emails in laravel. I am able to build connection but message returning null

code -> $oClient = \Webklex\IMAP\Facades\Client::account('default'); $connect =$oClient->connect(); $folder = $oClient->getFolder('INBOX'); $message = $folder->query()->get()->first(); dd( $message);

makedreams45 avatar Mar 09 '22 11:03 makedreams45

Hi @makedreams45 , it looks like you aren't providing any criteria. Try something like this:

$message = $folder->query()->all()->get()->first();

Checkout https://www.php-imap.com/api/query for more query and usage examples :)

Best regards,

Webklex avatar Mar 09 '22 18:03 Webklex

Thanks, can I ask you for extra help? You provided me APIs of PHP-IMAP. is APIs are different for PHP-imap and laravel-imap? if different , can you provide same for laravel-imap?

makedreams45 avatar Mar 14 '22 04:03 makedreams45