php-imap
php-imap copied to clipboard
connection setup failed
Describe the bug the times i receive the error "connection setup failed" but the configs is right when i try connect in outlook using OAuth2.0, but no is always that this do, i using the version 4 of the webklex
Used config $cm = new \Webklex\PHPIMAP\ClientManager(); $imapClient = $cm->make([ 'host' => "outlook.office365.com", 'port' => 993, 'protocol' => 'imap', 'encryption' => "ssl", 'validate_cert' => false, 'username' => "[email protected]", 'password' => "mytokenoauth", 'authentication' => 'oauth', 'proxy' => [ 'socket' => null, 'request_fulluri' => false, 'username' => null, 'password' => null, ], "timeout" => 30, "extensions" => [] ]); Desktop / Server (please complete the following information):
- OS: Ubuntu 18.04
- PHP: "php": ">=7.0.0"
- Version "webklex/laravel-imap": "^4.0"
- Provider Outlook
Hi @Webklex
Did anyone get the solution for the above issue I'm also getting the same error.
connection setup failed {"exception":"[object] (Webklex\PHPIMAP\Exceptions\ConnectionFailedException(code: 0): connection setup failed at applicationFolder\spst\laravel\vendor\webklex\php-imap\src\Client.php:391)
This error comes all of a sudden and if we check another day it works hence causing the misunderstanding that where in the code issue exists.
Hi @wawa67 @nitin-usualsmart , many thanks for your reports. Unfortunately this can have many different causes.
Here are some things you can try:
- Enable the debug mode (https://github.com/Webklex/php-imap/blob/master/src/config/imap.php#L152) this will dump the imap server communication and might provide some additional insight.
- Outlook / Azure has some unique challenges. You have to tick the correct boxes and set the right scopes. It's easy to forget something somewhere.
- Checkout these issues: https://github.com/Webklex/php-imap/issues?q=+outlook+oauth there are a lot of people who shared how they've solved their issue.
If the issue persists, please share some additional information - perhaps someone spots the issue and is able to help or chip in their ideas.
Best regards and happy coding,