Im trying to fetch unread mails from a google apps mail account.
Ive been trying the follow script:
$email = 'name@domain.com';
$pass = 'password';
$inbox = imap_open('{imap.gmail.com:993/imap/ssl}INBOX', $email, $pass, NULL, 1) or die('Cannot connect to Gmail');
.. but I get the following error:
Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl}INBOX in /var/www/zvinx.dk/test/gmail.php on line 5
Cannot connect to Gmail
I've contacted my webhost and he states that imap_open is supported by the webhotel. Is there a certain way to check this?
Basicly, how do I display and flag the mails as read with php?