0
votes

I am trying to get mails from gmail using zend framework from imap.

I have refer link https://github.com/google/gmail-oauth2-tools/blob/master/php/oauth2.php

and getting error as follows

PHP Fatal error: Uncaught Zend_Mail_Protocol_Exception: cannot connect to host; error = (errno = 0 ) in C:\inetpub\wwwroot\bephpforTteam\New\gmailread1\Zend\Mail\Protocol\Imap.php:100 Stack trace: #0 C:\inetpub\wwwroot\bephpforTteam\New\gmailread1\Zend\Mail\Protocol\Imap.php(61): Zend_Mail_Protocol_Imap->connect('ssl://imap.gmai...', '993', true) #1 C:\inetpub\wwwroot\bephpforTteam\New\gmailread1\oauth2.php(105): Zend_Mail_Protocol_Imap->__construct('imap.gmail.com', '993', true) #2 C:\inetpub\wwwroot\bephpforTteam\New\gmailread1\oauth2.php(137): tryImapLogin('emailid...', 'token...') #3 {main} thrown in C:\inetpub\wwwroot\bephpforTteam\New\gmailread1\Zend\Mail\Protocol\Imap.php on line 100

Please help me

1

1 Answers

0
votes

Check your config, it states in the error that it could not connect to the host. Make sure you have the correct credentials. Also, hide your email and password credentials, you have them posted for the world to see.