-
-
Notifications
You must be signed in to change notification settings - Fork 184
Open
Description
Hello @Webklex ,
I done below code for outlook/hotmail account IMAP connection
$client = $clientManager->make([
'host' => 'outlook.office365.com',
'port' => 993,
'encryption' => 'ssl', // Or 'tls' or null
'validate_cert' => true,
'username' => EMAIL, // Username for the before configured mailbox
'password' => MS_ENTRA_ACCESS_TOKEN,
'protocol' => 'imap' // Or 'pop3'
]);
// Connect to the server
$client->connect();
$folders = $client->getFolders();
foreach ($folders as $folder) {
echo "Folder: " . $folder->name . "\n";
// Get messages from the folder
$messages = $folder->messages()->all()->limit(5)->get();
foreach ($messages as $message) {
echo "Subject: " . $message->getSubject() . "\n";
echo "From: " . $message->getFrom()[0]->mail . "\n";
echo "--------------------------------------\n";
}
}
exit;
And get below output with error :
PHP Fatal error: Uncaught Webklex\PHPIMAP\Exceptions\ImapServerErrorException: NO LOGIN failed.
Could you please advise on how to resolve this?
Metadata
Metadata
Assignees
Labels
No labels