Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imap_open(): Couldn't open stream {outlook.office365.com:993/imap/ssl} #187

Closed
rohit-2018 opened this issue Dec 27, 2018 · 5 comments
Closed

Comments

@rohit-2018
Copy link

ERROR: imap_open(): Couldn't open stream {outlook.office365.com:993/imap/ssl}

Retrying PLAIN authentication after AUTHENTICATE failed.; Retrying PLAIN authentication after AUTHENTICATE failed.; Can not authenticate to IMAP server: AUTHENTICATE failed. {"exception":"[object] (Webklex\IMAP\Exceptions\ConnectionFailedException(code: 0): imap_open(): Couldn't open stream {outlook.office365.com:993/imap/ssl}. Retrying PLAIN authentication after AUTHENTICATE failed.; Retrying PLAIN authentication after AUTHENTICATE failed.; Can not authenticate to IMAP server: AUTHENTICATE failed. at /var/www/html/ats1/api-pms/vendor/webklex/laravel-imap/src/IMAP/Client.php:221

@jimmY276
Copy link

show me your code i will help you

@poseidonphp
Copy link

show me your code i will help you

Any chance you could post the solution?

@Webklex
Copy link
Owner

Webklex commented Mar 11, 2019

Hi @rohit-2018 @poseidonphp ,
please take a look at these issues: #153 #100 #78.

So far it could be caused by to many things. Please try to provide some more information (code samples, call stacks, etc) in order to figure things out :)

Best regards

@yojann96
Copy link

how can i fix: imap_open(): Couldn't open stream {outlook.office365.com:993/imap/ssl}

@maatinito
Copy link

maatinito commented Apr 24, 2020

So far, IF you have a shared mailbox, the parameters for the user name should be something like [email protected]\sharedmailboxname like [email protected]\info.
But imap_open failed to authenticate.
The only solution I've found was to patch the getAddress() function in Client.php

        $slash = strpos($this->username,'\\');  
        if ($slash > 0) {  
            $address .= '/authuser=' . substr($this->username,0,$slash);  
            $address .= '/user=' . substr($this->username,$slash+1);  
        }  
        $address .= '}';  

==> address becomes {outlook.office.com:993/imap/ssl/[email protected]/user=info}
Of course, try first your connection parameters using either thunderbird (configure thunderbird for office and/or test your connection using openssl (manually testing imap) to be sure you don't have a problem with the mailbox or your credentials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants