PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > trouble trying to connect to gmail server.
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
trouble trying to connect to gmail server.

Réponse
 
LinkBack Outils de la discussion
Vieux 19/09/2007, 04h53   #1
Fábio Generoso
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut trouble trying to connect to gmail server.

I have a little trouble while trying to connect to gmail server.
I already enabled POP on gmail.
After experience a lots of errors with the command below, now I'm
seeing no more errors, but it still doesn't working, the page stay
processing and just is broke after this command.

$mbox = imap_open('{pop.gmail.com:995/pop3}INBOX',
'my_login@gmail.com', 'my_pass');

What should I do?

Tks in advance.
  Réponse avec citation
Vieux 19/09/2007, 05h16   #2
Chris
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] trouble trying to connect to gmail server.

Fábio Generoso wrote:
> I have a little trouble while trying to connect to gmail server.
> I already enabled POP on gmail.
> After experience a lots of errors with the command below, now I'm
> seeing no more errors, but it still doesn't working, the page stay
> processing and just is broke after this command.
>
> $mbox = imap_open('{pop.gmail.com:995/pop3}INBOX',
> 'my_login@gmail.com', 'my_pass');


What is $mbox at this point? A resource or false?

print_r(imap_alerts());
print_r(imap_errors());

anything in those?

--
Postgresql & php tutorials
http://www.designmagick.com/
  Réponse avec citation
Vieux 24/09/2007, 18h18   #3
Fábio Generoso
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut [PHP] trouble trying to connect to gmail server.

Thanks for offer your .
I will try to explain in details what I did.

First of all, on file php.ini I removed the comments for the line below:

extension=php_imap.dll

After that, I have followed the Gmail instructions to enable POP in my Gmail
account as below:

1. Log in to your Gmail account.
2. Click Settings at the top of any Gmail page.
3. Click Forwarding and POP.
4. Select Enable POP for all mail.
5. Choose "Keep Gmail's copy in the inbox" when messages are accessed with
POP.

When I run the simple code below:

<?
$mbox = imap_open('{pop3.gmail.com:995/pop3}INBOX<http://pop3.gmail.com:995/pop3%7DINBOX>',
'<my_login>@ gmail.com', '<my_pass>');
print_r(imap_alerts());
print_r(imap_errors());
$num_mens_not_read = imap_num_recent($mbox);
imap_close($mbox);
?>

I get these errors:

Warning: imap_open(): Couldn't open stream
{pop3.gmail.com:995/pop3}INBOX<http://pop3.gmail.com:995/pop3%7DINBOX>in
c:\arquivos de programas\easyphp1-8\www\index.php on line 2
Array ( [0] => Host not found (#11001): pop3.gmail.com )
Warning: imap_num_recent(): supplied argument is not a valid imap resource
in c:\arquivos de programas\easyphp1-8\www\index.php on line 5
Warning: imap_close(): supplied argument is not a valid imap resource in
c:\arquivos de programas\easyphp1-8\www\index.php on line 6

And, when I run the simple code below:

<?
$mbox = imap_open('{pop.gmail.com:995/pop3}INBOX<http://pop.gmail.com:995/pop3%7DINBOX>',
'<my_login>@gmail.com', <my_pass>');
print_r(imap_alerts());
print_r(imap_errors());
$num_mens_not_read = imap_num_recent($mbox);
imap_close($mbox);
?>

I get these errors:

Warning: imap_open(): Couldn't open stream {
pop.gmail.com:995/pop3}INBOX<http://pop.gmail.com:995/pop3%7DINBOX>in
c:\arquivos de programas\easyphp1-8\www\index.php on line 4
Fatal error: Maximum execution time of 30 seconds exceeded in c:\arquivos de
programas\easyphp1-8\www\index.php on line 4
Notice: (null)(): POP3 connection broken in response (errflg=2) in Unknown
on line 0


This second code looks like ok for me, but for some reason I get this time
out. Do you have any idea what's going on? Did I miss some configuration?


Thanks in advance.



On 9/19/07, Chris < dmagick@gmail.com> wrote:
> Fábio Generoso wrote:
> > I have a little trouble while trying to connect to gmail server.
> > I already enabled POP on gmail.
> > After experience a lots of errors with the command below, now I'm
> > seeing no more errors, but it still doesn't working, the page stay
> > processing and just is broke after this command.
> >
> > $mbox = imap_open('{ pop.gmail.com:995/pop3}INBOX<http://pop.gmail.com:995/pop3%7DINBOX>

',
> > 'my_login@gmail.com', 'my_pass');

>
> What is $mbox at this point? A resource or false?
>
> print_r(imap_alerts());
> print_r(imap_errors());
>
> anything in those?
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>


  Réponse avec citation
Vieux 25/09/2007, 03h22   #4
Chris
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] trouble trying to connect to gmail server.


> Array ( [0] => Host not found (#11001): pop3.gmail.com )


So pop3.gmail.com doesn't exist.

> <?
> $mbox = imap_open('{pop.gmail.com:995/pop3}INBOX<http://pop.gmail.com:995/pop3%7DINBOX>',
> '<my_login>@gmail.com', <my_pass>');
> print_r(imap_alerts());
> print_r(imap_errors());
> $num_mens_not_read = imap_num_recent($mbox);
> imap_close($mbox);
> ?>
>
> I get these errors:
>
> Warning: imap_open(): Couldn't open stream {
> pop.gmail.com:995/pop3}INBOX<http://pop.gmail.com:995/pop3%7DINBOX>in
> c:\arquivos de programas\easyphp1-8\www\index.php on line 4
> Fatal error: Maximum execution time of 30 seconds exceeded in c:\arquivos de
> programas\easyphp1-8\www\index.php on line 4
> Notice: (null)(): POP3 connection broken in response (errflg=2) in Unknown
> on line 0
>
>
> This second code looks like ok for me, but for some reason I get this time
> out. Do you have any idea what's going on? Did I miss some configuration?


Line 4 is

$num_mens_not_read = imap_num_recent($mbox);

so it's taking too long to work out how many are recent.

How many unread messages are there in your account? How many messages in
total?

--
Postgresql & php tutorials
http://www.designmagick.com/
  Réponse avec citation
Vieux 27/09/2007, 01h09   #5
Fábio Generoso
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] trouble trying to connect to gmail server.

*Hi Cris,*

*I have tried to use:*

*$mbox = imap_open('{**pop.gmail.com:995/pop3}INBOX<http://pop.gmail.com:995/pop3%7DINBOX>
**<**http://pop.gmail.com:995/pop3%7DINBOX**>',*

*> '<my_login>@**gmail.com**', <my_pass>');*

*As you suggest but it didn't work. *



*The time out is not for the function:*

*imap_num_recent($mbox);*

*It is for the function:*

*imap_open('{pop.gmail.com:995/pop3}INBOX', '<my_login>@**gmail.com**',
<my_pass>'**);*



*In order to confirm that, I have created a new account with just 5 e-mails
and I have gotten the same problem.*

*And... I also check that using the code without the function*:
imap_num_recent($mbox); *as* *bellow:*

*$mbox = imap_open('{pop.gmail.com:995/pop3}INBOX','fhgeneroso@gmail.com',
'O3S/4o1*');*

*print_r(imap_alerts());*

*print_r(imap_errors());*



*I got the same message error:*

*Warning**: imap_open(): Couldn't open stream
{pop.gmail.com:995/pop3}INBOXin c:\arquivos
de programas\easyphp1-8\www\index.php on line 4

Fatal error: Maximum execution time of 30 seconds exceeded in c:\arquivos de
programas\easyphp1-8\www\index.php on line 4

Notice: (null)(): POP3 connection broken in response (errflg=2) in
Unknownon line
0*

* *

*So I have tried to use the function* *set_time_limit(0);* *to suppress the
time out but it still didn't work:*

*set_time_limit(0);*

*$mbox = imap_open('{pop.gmail.com:995/pop3}INBOX','fhgeneroso@gmail.com',
'O3S/4o1*');*

*print_r(imap_alerts());*

*print_r(imap_errors());*



*I got these errors:*

*Warning**: imap_open(): Couldn't open stream
{pop.gmail.com:995/pop3}INBOXin c:\arquivos
de programas\easyphp1-8\www\index.php on line 4
Array ( [0] => POP3 connection broken in response )*



*Looks like I have reached the gmail server but for same configuration or
network issue, I'm not able to receive the answer. *

*Any suggestion?*

* *

*Tks.*


On 9/24/07, Chris <dmagick@gmail.com> wrote:
>
>
> > Array ( [0] => Host not found (#11001): pop3.gmail.com )

>
> So pop3.gmail.com doesn't exist.
>
> > <?
> > $mbox = imap_open('{pop.gmail.com:995/pop3}INBOX<

> http://pop.gmail.com:995/pop3%7DINBOX>',
> > '<my_login>@gmail.com', <my_pass>');
> > print_r(imap_alerts());
> > print_r(imap_errors());
> > $num_mens_not_read = imap_num_recent($mbox);
> > imap_close($mbox);
> > ?>
> >
> > I get these errors:
> >
> > Warning: imap_open(): Couldn't open stream {
> > pop.gmail.com:995/pop3}INBOX<http://pop.gmail.com:995/pop3%7DINBOX>in
> > c:\arquivos de programas\easyphp1-8\www\index.php on line 4
> > Fatal error: Maximum execution time of 30 seconds exceeded in

> c:\arquivos de
> > programas\easyphp1-8\www\index.php on line 4
> > Notice: (null)(): POP3 connection broken in response (errflg=2) in

> Unknown
> > on line 0
> >
> >
> > This second code looks like ok for me, but for some reason I get this

> time
> > out. Do you have any idea what's going on? Did I miss some

> configuration?
>
> Line 4 is
>
> $num_mens_not_read = imap_num_recent($mbox);
>
> so it's taking too long to work out how many are recent.
>
> How many unread messages are there in your account? How many messages in
> total?
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>


  Réponse avec citation
Vieux 27/09/2007, 08h08   #6
Tom Chubb
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] trouble trying to connect to gmail server.

This may not be relevant as I'm only glancing over this as I have to
leave for a meeting, but you have to enable POP access in Gmail before
you can download to another email client like Thunderbird or Outlook,
so maybe the same applies?
Anyway, I'm looking to find a way of accessing my gmail as I am unable
to access it at work as the Gmail site is blocked so please let me
know if you find a successful way of connecting!
Thanks,

Tom

On 27/09/2007, Fábio Generoso <generoso.etp@gmail.com> wrote:
> *Hi Cris,*
>
> *I have tried to use:*
>
> *$mbox = imap_open('{**pop.gmail.com:995/pop3}INBOX<http://pop.gmail.com:995/pop3%7DINBOX>
> **<**http://pop.gmail.com:995/pop3%7DINBOX**>',*
>
> *> '<my_login>@**gmail.com**', <my_pass>');*
>
> *As you suggest but it didn't work. *
>
>
>
> *The time out is not for the function:*
>
> *imap_num_recent($mbox);*
>
> *It is for the function:*
>
> *imap_open('{pop.gmail.com:995/pop3}INBOX', '<my_login>@**gmail.com**',
> <my_pass>'**);*
>
>
>
> *In order to confirm that, I have created a new account with just 5 e-mails
> and I have gotten the same problem.*
>
> *And... I also check that using the code without the function*:
> imap_num_recent($mbox); *as* *bellow:*
>
> *$mbox = imap_open('{pop.gmail.com:995/pop3}INBOX','fhgeneroso@gmail.com',
> 'O3S/4o1*');*
>
> *print_r(imap_alerts());*
>
> *print_r(imap_errors());*
>
>
>
> *I got the same message error:*
>
> *Warning**: imap_open(): Couldn't open stream
> {pop.gmail.com:995/pop3}INBOXin c:\arquivos
> de programas\easyphp1-8\www\index.php on line 4
>
> Fatal error: Maximum execution time of 30 seconds exceeded in c:\arquivosde
> programas\easyphp1-8\www\index.php on line 4
>
> Notice: (null)(): POP3 connection broken in response (errflg=2) in
> Unknownon line
> 0*
>
> * *
>
> *So I have tried to use the function* *set_time_limit(0);* *to suppress the
> time out but it still didn't work:*
>
> *set_time_limit(0);*
>
> *$mbox = imap_open('{pop.gmail.com:995/pop3}INBOX','fhgeneroso@gmail.com',
> 'O3S/4o1*');*
>
> *print_r(imap_alerts());*
>
> *print_r(imap_errors());*
>
>
>
> *I got these errors:*
>
> *Warning**: imap_open(): Couldn't open stream
> {pop.gmail.com:995/pop3}INBOXin c:\arquivos
> de programas\easyphp1-8\www\index.php on line 4
> Array ( [0] => POP3 connection broken in response )*
>
>
>
> *Looks like I have reached the gmail server but for same configuration or
> network issue, I'm not able to receive the answer. *
>
> *Any suggestion?*
>
> * *
>
> *Tks.*
>
>
> On 9/24/07, Chris <dmagick@gmail.com> wrote:
> >
> >
> > > Array ( [0] => Host not found (#11001): pop3.gmail.com )

> >
> > So pop3.gmail.com doesn't exist.
> >
> > > <?
> > > $mbox = imap_open('{pop.gmail.com:995/pop3}INBOX<

> > http://pop.gmail.com:995/pop3%7DINBOX>',
> > > '<my_login>@gmail.com', <my_pass>');
> > > print_r(imap_alerts());
> > > print_r(imap_errors());
> > > $num_mens_not_read = imap_num_recent($mbox);
> > > imap_close($mbox);
> > > ?>
> > >
> > > I get these errors:
> > >
> > > Warning: imap_open(): Couldn't open stream {
> > > pop.gmail.com:995/pop3}INBOX<http://pop.gmail.com:995/pop3%7DINBOX>in
> > > c:\arquivos de programas\easyphp1-8\www\index.php on line 4
> > > Fatal error: Maximum execution time of 30 seconds exceeded in

> > c:\arquivos de
> > > programas\easyphp1-8\www\index.php on line 4
> > > Notice: (null)(): POP3 connection broken in response (errflg=2) in

> > Unknown
> > > on line 0
> > >
> > >
> > > This second code looks like ok for me, but for some reason I get this

> > time
> > > out. Do you have any idea what's going on? Did I miss some

> > configuration?
> >
> > Line 4 is
> >
> > $num_mens_not_read = imap_num_recent($mbox);
> >
> > so it's taking too long to work out how many are recent.
> >
> > How many unread messages are there in your account? How many messages in
> > total?
> >
> > --
> > Postgresql & php tutorials
> > http://www.designmagick.com/
> >

>



--
Tom Chubb
tomchubb@gmail.com
07912 202846
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 16h09.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,19854 seconds with 14 queries