javanile / php-imap2

PHP IMAP with OAUTH2
https://php-imap2.javanile.org/
GNU General Public License v3.0
52 stars 31 forks source link

Can't connect to Microsoft Office #4

Closed KodaCHC closed 2 years ago

KodaCHC commented 2 years ago

I am trying to connect to Microsoft right now.

$server = 'outlook.office365.com';
        $username = 'myusername';
        $token = 'xxxxxxx';

        require_once('./javanile/php-imap2/vendor/autoload.php');
        $mbh = imap2_open($server, $username, $token, OP_XOAUTH2);
        if (!$mbh) {
            error_log(imap_last_error());
            throw new \RuntimeException('Unable to open Google INBOX');
        }

Now i get this error Undefined array key "host"

The problem is the content of $mailboxParts

  1. I miss the first letter of Host :)
  2. No mailbox content or Port or other:

Array Content:

Array
(
    [path] => Array
        (
            [0] => utlook.office365.com
        )

    [mailbox] => 
)
francescobianco commented 2 years ago

Hi @KodaCHC , please refer to this examples for the exact Microsoft Outlook solutions