Hey,

I am trying to connect to my gmail account using the script below, but i can't connect. Does anyone know how to do this or what i am doing wrong. I essentially want to fetch my emails and then parse them... Any help is appreciated!

$mail = @imap_open('{pop.gmail.com:995/novalidate-cert/pop3/ssl}',
'******@gmail.com', 'password')
or die("Connection to server failed");

i have enabled pop3 forwarding in gmail.. im using XAMPP (apache, mercurymail, mysql, php and all of that good stuff) and am currently working off of localhost.

Thanks!

    take the @ off the @imap_open and see what error it returns

      yea...also just try running it without the or die....so it shows all errors. Then post

        if i remove the @ then this is the error thats posted..

        Warning: imap_open() [function.imap-open]: Couldn't open stream {pop.gmail.com:995/novalidate-cert/pop3/ssl} in C:\Program Files\xampp\webdav\testMailConnect.php on line 8

        line 8 reads:
        $mail = imap_open('{pop.gmail.com:995/novalidate-cert/pop3/ssl}', 'teamcosdster@gmail.com', 'password'')

        when the @ is included, no errors are listed..

        i have not written any other lines of code, because if i can't get it to connect then I cant really do much else after that...

        i am new with PHP and i was basically following the PHP cookbook by O'reilly, but its not helping..haha..

        any other ideas guys?

        thanks for ur help..

          he's using the pop3 flag already (third flag or so), but I think it's incorrect....

          Try this:

          $mail = imap_open('{pop.gmail.com:995/pop3/ssl/novalidate-cert}', 'teamcosdster@gmail.com', 'password'');

          That as adapted from php.net:

          // To connect to an SSL IMAP or POP3 server with a self-signed certificate,
          // add /ssl/novalidate-cert after the protocol specification:
          $mbox = imap_open ("{localhost:995/pop3/ssl/novalidate-cert}", "user_id", "password");
            Write a Reply...