PHP Classes

Connecting to gmail

Recommend this page to a friend!

      pop3.class.inc  >  All threads  >  Connecting to gmail  >  (Un) Subscribe thread alerts  
Subject:Connecting to gmail
Summary:How do I connect to Gmail with the pop3 class
Messages:6
Author:Finnian
Date:2007-10-08 04:15:07
Update:2007-10-23 18:34:17
 

  1. Connecting to gmail   Reply   Report abuse  
Picture of Finnian Finnian - 2007-10-08 04:15:07
Hi,
how do I connect to Gmail with this class? I enabled POP in my Gmail settings, but it simply doesn't work. It loads for ever (maybe that's just my computer, but I don't think so), then comes up blank! PLEASE HELP!

thanks,
Finn

  2. Re: Connecting to gmail   Reply   Report abuse  
Picture of Steffen Stollfuß Steffen Stollfuß - 2007-10-08 10:34:33 - In reply to message 1 from Finnian
Hi,

can you please post the script which you are using.
And the log file that will generate if enable.

Check before you post this here that you remove all username and passwords.

j0inty.sL

  3. Re: Connecting to gmail   Reply   Report abuse  
Picture of Finnian Finnian - 2007-10-08 17:24:51 - In reply to message 2 from Steffen Stollfuß
Sorry, i forgot to do that. here's the code I'm using:

<?php

require ('pop3.class.inc');
$pop3 = new POP3;
$do = $pop3->connect ('pop.gmail.com', '995', '25', '50');
if ($do == false)
{die($pop3->error);}
else
{
echo 'Connected to mail server';
// Login to your inbox
$do = $pop3->login ('myEmailAddress@gmail.com', 'myPassword***');
if ($do == false)
{die($pop3->error);}
else
{echo 'Logged in';}
}
$pop3->close();
?>
I've tried a couple of variations on that code, nothing works





  4. Re: Connecting to gmail   Reply   Report abuse  
Picture of Steffen Stollfuß Steffen Stollfuß - 2007-10-09 16:46:12 - In reply to message 3 from Finnian
The answer is really simple.

You try to connect to a pop3 server who needs TLS encryption (Port: 995)

The class CAN'T handle this connection.

I had tested the port 110 (default pop3 port) but this dooesn't work.

So this class isn't use able with gmail. :(

For the php5 Version i plan a TLS support, but this will need some time.

regards
j0inty.sL

  5. Re: Connecting to gmail   Reply   Report abuse  
Picture of Finnian Finnian - 2007-10-09 22:22:12 - In reply to message 4 from Steffen Stollfuß
OK thank you

  6. Re: Connecting to gmail   Reply   Report abuse  
Picture of Dan Dan - 2007-10-23 18:34:17 - In reply to message 5 from Finnian
you just set tls to 1, and use port 995 instead of 110

 
For more information send a message to info at phpclasses dot org.