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

Can't search within text from Office 365 Mail

Open SuryaJD opened this issue 1 year ago • 3 comments

Describe the bug I am using this package to search email containing specific text within Office 365. I am using the same code for Gmail as well. But search functionality is working fine there. So, the problem should be with Office 365. May I miss anything.

To Reproduce

  1. Connect Office 365 using IMAP
  2. Search into inbox folder using text($string) method.
  3. Or use Where() Method
        $inbox->query()->where([
            ['KEYWORD' => 'Hello'],
            ['TEXT' => 'Hello']
        ])->get()->each(function ($message) use ($jd) {
            if ($message->hasTextBody()) {
                dump($message->getAttributes());
            }else {
                dump($message->getSubject());
            } 
        });

Expected behavior I should get the collection of emails containing those words. but currently an empty array is returning.

Desktop / Server

  • OS: Windows 11 (Local), Ubuntu 20 (Production)
  • PHP: 8.1.0 and 7.4.3 (Local), 7.4.3 (Production)
  • Version: 2.4.0

SuryaJD avatar Mar 16 '23 13:03 SuryaJD

can you please share how you are able to use imap on office 365

seuntech avatar Apr 20 '23 00:04 seuntech

@SuryaJD , can you describe how to use imap on office365 plz ! :D

MouMoutMan avatar Jun 21 '23 14:06 MouMoutMan

@SuryaJD , can you describe how to use imap on office365 plz ! :D https://www.php-imap.com/examples/oauth

SuryaJD avatar Jul 18 '23 23:07 SuryaJD