What ports do I need open for IMAP connections
- by iamjonesy
I'm developing a web application that connects to an IMAP mailbox and fetches emails as part of it's functionality.
The application is PHP and I'm connecting like this:
public function connect()
{
/* connect to gmail */
$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
$username = $this->username;
$password = $this->password;
/* try to connect */
$this->inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());
}
Developing locally on my mac this was fine, I was able to connect and get emails. However now that I've put the app on my web hosts server I'm getting the following error:
Cannot connect to Gmail: Can't connect to gmail-imap.l.google.com,993: Connection timed out
After checking with my hosting provider they told me outgoing connections on port 993 are blocked. Is there anyway around this? Otherwise I need to upgrade to a dedicated server :S