I am wanting to return emails of a specified senders email address only using IMAP and PHP, however the only example ive found that i can get working returns all emails, due to the amount of emails stored the code below takes a long time and often times out.
i have zero experience with this, and have read the php.net manual along with other resources so come to a dead end.
$mbox = imap_open("{outlook.office365.com:993/ssl}INBOX", "email-xxx", "pass-xxx")
or die("can't connect: " . imap_last_error());
$MC = imap_check($mbox);
// Fetch an overview for all messages in INBOX
$result = imap_fetch_overview($mbox,"1:{$MC->Nmsgs}",0);
var_dump($result);