PHP Classes

Socket Time out

Recommend this page to a friend!

      pop3.class.inc  >  All threads  >  Socket Time out  >  (Un) Subscribe thread alerts  
Subject:Socket Time out
Summary:Cannot connect to gmail
Messages:4
Author:Robert
Date:2008-06-23 20:21:24
Update:2009-02-07 05:36:17
 

  1. Socket Time out   Reply   Report abuse  
Picture of Robert Robert - 2008-06-23 20:21:25
I found a short little article on this class and I was trying this:

<?php
require ('pop3.class.inc');

$pop3 = new POP3;

// Connect to mail server
$do = $pop3->connect ('pop.gmail.com');
if ($do == false) {
die($pop3->error);
}

echo 'Connected to mail server';

$pop3->close();

?>

I am getting socket time out. I understand that gmail uses ssl, do you think that is the problem or something else? What it be a big hassel to modify this to support ssl clients? Where would I start?

  2. Re: Socket Time out   Reply   Report abuse  
Picture of Steffen Stollfuß Steffen Stollfuß - 2008-06-24 13:15:51 - In reply to message 1 from Robert
Hi,

>I understand that gmail uses ssl, do you think that is the problem or something else?

You are right !

This class isn't usable with gmail.

  3. Re: Socket Time out   Reply   Report abuse  
Picture of asdfasaf asdfasaf - 2009-02-04 15:51:15 - In reply to message 2 from Steffen Stollfuß
if you have compiled in OpenSSL support, you may prefix the hostname with either ssl:// or tls:// to use an SSL or TLS client connection over TCP/IP to connect to the remote host.


Refer : http://forums.whirlpool.net.au/forum-replies-archive.cfm/894598.html

  4. Re: Socket Time out   Reply   Report abuse  
Picture of Steffen Stollfuß Steffen Stollfuß - 2009-02-07 05:36:17 - In reply to message 3 from asdfasaf
Hi.

Yes you a right, through this bug (design error) it is possible to bypass the protocol identifier to the fsockopen function.

When your PHP is well configured for ssl/tls connection you can use this support with the PHP4 Version of the pop3.class.

The PHP5 will call the fsockopen with tcp:// prefix. I think I will remove that, so the php5 version with streams will support ssl/tls stuff, too.

j0inty