fetching gmail inbox with imap
-
13-10-2019 - |
Question
i got a code from here to download 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 have searched on stackoverflow but did't got solution
thanks
Solution
You can download my Gmail class at my website: . I have also included a test file for you to test the class file.
If it does not work, I believe it could be your server's problem. You should contact your system administrator.
OTHER TIPS
change you host name to this one and try
$hostname= '{imap.gmail.com:993/ssl/novalidate-cert}';
and double check the username and password
Open the php.ini
file and remove ;
before ;extension=php_imap.dll
and restart your server.
Your code will work...
One of the issues with gmail IMAP SSL authentication is related to Google's account security.Once you get the login error once, sign out of all your google accounts. Then, visit this link: https://accounts.google.com/DisplayUnlockCaptcha
Log in with the account you're attempting to access via imap.
Follow the steps and you'll then be able to login in to gmail with php imap.
It's visually shown here: http://jeffreifman.com/filtered-open-source-imap-mail-filtering-software-for-php/configuring-gmail/