<?php
$mbox = imap_open("{imap.gmail.com:993/ssl/novalidate-cert}INBOX", "myemail@gmail.com", "PASSWORD");
$old_msg_numbers = imap_search($mbox, "");
echo "This should report the message numbers retrieved from GMail\r\n";
var_dump($old_msg_numbers);
echo "\r\nimap_errors:\r\n";
var_dump(imap_errors());
echo "\r\nimap_alerts:\r\n";
var_dump(imap_alerts());
imap_close($mbox);
phpinfo();
?>
When I run this locally on my Windows machine, with XAMPP and PHP, it runs and works properly. any time I give it to a hosting company, it doesn't run, instead it generates the PHP warning here:
PHP Warning: imap_open() [<a href='function.imap-open'>function.imap-open</a>]: Couldn't open stream {imap.gmail.com:993/ssl/novalidate-cert}INBOX in /path-goes-here/test.php on line 3
I have used this on two different hosting providers, hostmonster.com and godaddy.com, they say they are not blocking port 993, which GMail requires.
Using Port settings defined by Google ( http://support.google.com/mail/bin/static.py?hl=en&ts=1668960&page=ts.cs&rd=1 ), and that shouldn't matter, because its working fine on my local machine.
What do?