IMAP error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
MindOverBody
Forum Commoner
Posts: 96
Joined: Fri Aug 06, 2010 9:01 pm
Location: Osijek, Croatia

IMAP error

Post by MindOverBody »

Well, out of boredom, I decided to retrieve my g-mails with simple PHP scripts and I stuck at the beginning. Problem is in imap_open function. I am running script on WampServer version 2.1. Apache Version is 2.2.17, and PHP Version is 5.3.4. WampServer is allowed in firewall. IMAP extension is loaded within WampServer, also checked in php.ini file. When I run page in browser (Chrome), it shows error message, something like this:

Image

Here is the code:

Code: Select all

$host = "{imap.gmail.com:993/imap/ssl}INBOX";
$user = "myaccount@gmail.com";
$pass = "mypass";
$mbox = @imap_open( $host, $user, $pass ) or die("Can not connect");
Anyone have solution for this, or any alternative function(s)?
Peter Kelly
Forum Contributor
Posts: 143
Joined: Fri Jan 14, 2011 5:33 pm
Location: England
Contact:

Re: IMAP error

Post by Peter Kelly »

Might sound stupid but is apache service actually running and have you set the website to online via wampp? Simple but common mistakes.
User avatar
MindOverBody
Forum Commoner
Posts: 96
Joined: Fri Aug 06, 2010 9:01 pm
Location: Osijek, Croatia

Re: IMAP error

Post by MindOverBody »

Yap, everything is running, wamp is online.
Peter Kelly
Forum Contributor
Posts: 143
Joined: Fri Jan 14, 2011 5:33 pm
Location: England
Contact:

Re: IMAP error

Post by Peter Kelly »

Does http://localhost/ work? or any other pages?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: IMAP error

Post by John Cartwright »

Do you have the IMAP extension installed?

What happens if you remove the @ in front of imap_connect
User avatar
MindOverBody
Forum Commoner
Posts: 96
Joined: Fri Aug 06, 2010 9:01 pm
Location: Osijek, Croatia

Re: IMAP error

Post by MindOverBody »

John Cartwright wrote:Do you have the IMAP extension installed?

What happens if you remove the @ in front of imap_connect
IMAP extension is installed, WampServer is restated also. When I remove @ same thing happens.
Peter Kelly wrote:Does http://localhost/ work? or any other pages?
Yes, my other pages, work perfectly. This one works too if i comment imap_open() function.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: IMAP error

Post by John Cartwright »

What do your php error logs say?
User avatar
MindOverBody
Forum Commoner
Posts: 96
Joined: Fri Aug 06, 2010 9:01 pm
Location: Osijek, Croatia

Re: IMAP error

Post by MindOverBody »

John Cartwright wrote:What do your php error logs say?
PHP error logs are empty, but, apache logs show this message:
[Wed Feb 09 16:26:26 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
Post Reply