Open
Description
Hello there,
I'm trying to establish an IMAP connection to an Outlook email account using the following PHP code:
$mailbox = new Mailbox(
'{outlook.office365.com:993/imap/ssl}INBOX',
[email protected],
APP_PASSWORD,
__DIR__,
'UTF-8'
);
try {
$mailbox->setAttachmentsIgnore(true);
$mailsIds = $mailbox->searchMailbox('ALL');
echo "Found " . count($mailsIds) . " emails.";
} catch (Exception $e) {
echo "IMAP connection failed: " . $e->getMessage();
}
exit;
However, I'm encountering the following error:
IMAP Authentication cancelledPHP Notice: Unknown: IMAP Authentication cancelled (errflg=2) in Unknown on line 0
I've tried using an app password, but the issue persists. Could you please advise on how to resolve this? I'm currently blocked and would greatly appreciate your prompt support.
Thank you in advance!