views:

400

answers:

1

I have some php code that I'm trying to use to connect to gmail using imap. Here's the code:

$hostname = '{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX';
$tmp_username = 'username';
$tmp_password = 'password';
$inbox = imap_open($hostname, $username, $password) or die(imap_last_error());

And I get this error output everytime i try to connect:

Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX in /var/www/PHP/EmailScript.php on line 14 Login aborted

I dont understand what could be wrong!! I've heard of people having SSL errors but this doesnt seem to be one of those. Please please please help me!!!!!

Edit: When trying to connect through telnet-ssl to imap.gmail.com i get the following output:

Trying 74.125.155.109... Connected to gmail-imap.l.google.com. Escape character is '^]'.

And nothing else happens, it just sticks there

A: 

I was just about to ask if you had a firewall up when you edited your question.

Your router or firewall may be configured to block port 993. You will have to open it to allow communication on that port. If the machine has a system administrator, you'll have to ask them. Otherwise, check the firewall software and/or router.

zombat
Well i'm running Ubuntu Server 8.04LTS behind a Linksys WRT54GS router. How would i go about checking if the port is blocked on either of these? Thanks!!
Alexander
I am able to get to the gmail through telnet, still getting errors though!!!
Alexander