Choosing a gmail mailbox with imap

I have the code from here to download the gmail inbox: http://davidwalsh.name/gmail-php-imap

use these 2 hostnames 
$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
{imap.gmail.com:993/imap/ssl/novalidate-cert/norsh}Inbox

but getting this error.

 Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl/novalidate-cert/norsh}Inbox in /home/medicalh/public_html/testmail.php on line 9
Cannot connect to Gmail: Can't connect to gmail-imap.l.google.com,993: Connection timed out

I searched on stackoverflow but didn't get a solution

thank

+3
source share
4 answers

You can upload my Gmail class to my website :. I also included a test file to validate the class file.

If this does not work, I believe that this may be the problem of your server. You should contact your system administrator.

+2
source

change the hostname to this and try

$hostname= '{imap.gmail.com:993/ssl/novalidate-cert}';

and double check your username and password

+4

php.ini ; ;extension=php_imap.dll .

...

+4

Source: https://habr.com/ru/post/1781968/


All Articles