barbushin / php-imap

Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)
MIT License
1.66k stars 457 forks source link

Retrying PLAIN authentication after AUTHENTICATE failed for outlook.com and hotmail.com accounts #726

Open adrianbecker013 opened 3 days ago

adrianbecker013 commented 3 days ago

Hello,

Hope you are doing well!

I am trying to access my outlook.com/hotmail.com account via IMAP using the following PHP code:

$mailbox = new PhpImap\Mailbox(  
    '{outlook.office365.com:993/imap/ssl}', 
    xxx Email address is removed for privacy xxx',
    'xxxxxxx', 
    __DIR__, 
    'US-ASCII'
);

$folder = $mailbox->getMailboxes('*');
print_r($folder);exit;

However, I am encountering the following error: IMAP connection error: ["Retrying PLAIN authentication after AUTHENTICATE failed.","Retrying PLAIN authentication after AUTHENTICATE failed.","Can not authenticate to IMAP server: AUTHENTICATE failed."]

I have already enabled IMAP and generated an app-specific password, which I am using in this code. Could you please let me know if I’m missing something or if there's anything else I should check?

Thanks in advance for your help.