PHP Classes

gmail

Recommend this page to a friend!

      POP3 e-mail client  >  All threads  >  gmail  >  (Un) Subscribe thread alerts  
Subject:gmail
Summary:error 111 when trying to connect to gmail
Messages:27
Author:Stefan Hartweg
Date:2007-01-18 07:56:49
Update:2008-07-18 00:21:05
 
  1 - 10   11 - 20   21 - 27  

  1. gmail   Reply   Report abuse  
Picture of Stefan Hartweg Stefan Hartweg - 2007-01-18 07:56:49
I cannot for the life of me figure out how to connect to gmail using this class.
I have tested the script both on my local server and on a remote server and I keep getting an 111 error.

Any idea?

Chemoul

  2. Re: gmail   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-01-18 16:33:53 - In reply to message 1 from Stefan Hartweg
You need to set the class to connect to port 995 of POP3 server pop.gmail.com with tls option set to 1.

If you are not able to access it, it is very likely that your network has a firewall blocking Gmail or port 995.

  3. Re: gmail   Reply   Report abuse  
Picture of Stefan Hartweg Stefan Hartweg - 2007-01-22 10:58:32 - In reply to message 2 from Manuel Lemos
thanks for the quick reply. I'm pretty sure that the settings are correct. Also I'm running the class on my local apache webserver, my email client has not trouble connecting to gmail, so I'm sure that the ports are open.
Are there any reported problems with this class used on a Windows Apache installation?

Thanks.

  4. Re: gmail   Reply   Report abuse  
Picture of Stefan Hartweg Stefan Hartweg - 2007-01-22 11:02:58 - In reply to message 3 from Stefan Hartweg
actually it's displaying Error 0, not error 11...

  5. Re: gmail   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-01-22 20:30:20 - In reply to message 3 from Stefan Hartweg
With some Windows firewalls you need to enable access individually to each program.

If you have a firewall running, try stopping the firewall while you try your script. If you can get through with the firewall stopped, the firewall is causing the problem.

  6. Re: gmail   Reply   Report abuse  
Picture of Stefan Hartweg Stefan Hartweg - 2007-01-23 07:04:39 - In reply to message 5 from Manuel Lemos
Hi,
that didn't work. It's still showing
Connecting to pop.gmail.com ...
Error: 0 could not connect to the host "pop.gmail.com"

with or without the firewall active. As I said, I can access pop gmail using outlook on the same computer so I don't think it's a firewall issue

  7. Re: gmail   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-01-23 12:43:27 - In reply to message 6 from Stefan Hartweg
This is odd because it is failing but the error is 0.

You need to go in the class OpenConnection function and remove the @ character from the fsockopen call. Hopefully that will make PHP exhibit the real connection error. You need to have track_errors option in php.ini On.

If it does not display anything, change the line below to return the connection error:

return($this->SetError($error." could not connect to the host \"".$this->hostname."\" ".$php_errormsg));

Just let me know if this shows the connection error message.

  8. Re: gmail   Reply   Report abuse  
Picture of Stefan Hartweg Stefan Hartweg - 2007-01-24 20:39:27 - In reply to message 7 from Manuel Lemos
Hmm.. it seems to be an SSL problem:
Warning: fsockopen(): no SSL support in this build in C:\webserver\htdocs\pop3.php on line 114

Warning: fsockopen(): unable to connect to pop.gmail.com:995 in C:\webserver\htdocs\pop3.php on line 114

I dont really know why because mod_ssl/2.0.52 OpenSSL/0.9.7e is loaded on my Apache. Again, this is a Windows XP installation.

Thank you for your help.

Steve

  9. Re: gmail   Reply   Report abuse  
Picture of Stefan Hartweg Stefan Hartweg - 2007-01-24 20:57:24 - In reply to message 8 from Stefan Hartweg
this seems to be a bug in PHP4, I will update PHP and report back

  10. Re: gmail   Reply   Report abuse  
Picture of Stefan Hartweg Stefan Hartweg - 2007-01-27 05:40:34 - In reply to message 9 from Stefan Hartweg
I can confirm that it is a PHP4 - SSL problem. Upgraded to PHP5 and works without any problems.

Thank you for your help.
Steve

 
  1 - 10   11 - 20   21 - 27