laravel-imap
laravel-imap copied to clipboard
Can't search within text from Office 365 Mail
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
- Connect Office 365 using IMAP
- Search into inbox folder using text($string) method.
- 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
can you please share how you are able to use imap on office 365
@SuryaJD , can you describe how to use imap on office365 plz ! :D
@SuryaJD , can you describe how to use imap on office365 plz ! :D https://www.php-imap.com/examples/oauth