codice:
<?PHP
require 'config.php';//contiene le variabili $CONFIG_USER1, CONFIG_PASS2, ecc.

function test($connection, $username, $password) {
    $stream = imap_open($connection, $username, $password);
    
    $status = imap_status(
        $stream,
        $connection.'INBOX',
        SA_MESSAGES
    );
    echo "$connection: Numero email: $status->messages\n\n";
    
    imap_close($stream);
}

test(
    '{imap-mail.outlook.com:993/imap/ssl/novalidate-cert}',
    $CONFIG_USER1,
    $CONFIG_PASS1
);
test(
    '{imap.googlemail.com:993/imap/ssl/novalidate-cert}',
    $CONFIG_USER2,
    $CONFIG_PASS2
);
Produce

codice:
PHP Notice:  Undefined property: stdClass::$messages in /mnt/storage-ntfs/pending/test.php on line 12
{imap-mail.outlook.com:993/imap/ssl/novalidate-cert}: Numero email: 

{imap.googlemail.com:993/imap/ssl/novalidate-cert}: Numero email: 3
Perchè l'account outlook da problemi, mente gmail no?