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

timeout with outlook mail server #230

Closed
maralbe opened this issue Jul 25, 2019 · 2 comments
Closed

timeout with outlook mail server #230

maralbe opened this issue Jul 25, 2019 · 2 comments

Comments

@maralbe
Copy link

maralbe commented Jul 25, 2019

Hi,
I'm trying to connect to outlook account to retrieve new emails.. using imap config, but I receive timeout error even when I'm trying to get one email!

my code was OK with gmail mail server, and I could get max 30 emails each time.. but with outlook I don't know what did I miss!

this is part of my code:

$client = new Client([
            'host'          => "outlook.office365.com",
            'port'          => 993,
            'encryption'    => "tls",
            'validate_cert' => true,
            'username'      => $username,
            'password'      => $password,
            'protocol'      => "imap"
        ]);

$client->connect();
$folder = $client->getFolder('INBOX');
$messages = $folder->query()->limit(1)->get();
@Webklex
Copy link
Owner

Webklex commented Jul 25, 2019

@maralbe
Copy link
Author

maralbe commented Jul 28, 2019

thanks for your reply @Webklex

my problem solved, but it wasn't because of the UTF-8 charset, in imap_search, actually I was getting the error while connecting to server not searching.. and it solved when I changed encryption from tls to ssl!
and now it works even without setting null for charset in imap_search.

$client = new Client([
            'host'          => "outlook.office365.com",
            'port'          => 993,
            'encryption'    => "ssl",
            'validate_cert' => true,
            'username'      => $username,
            'password'      => $password,
            'protocol'      => "imap"
        ]);

$client->connect();
$folder = $client->getFolder('INBOX');
$messages = $folder->query()->limit(1)->get();

thanks.

@maralbe maralbe closed this as completed Jul 28, 2019
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

2 participants