PDA

View Full Version : retrieve imap email with PHP



starbuck
02-01-2007, 06:49 PM
Hi,
I'm trying to run some PHP code to retreive my imap email. My PHP code is running on BH and my email is there also.

The code that fails is:
$mbox = imap_open("{localhost:143}", $mailbox, $password);
and the error is:
Couldn't open stream

What is missing? I suppose I have to replace "{localhost:143}" with something more specific to BH but I don't know what exactly. I asked BH and they don't know.

Thanks!

Pethens
02-01-2007, 07:54 PM
Compare your code with the examples on this page, your code doesn't look quite right:

http://us2.php.net/manual/en/function.imap-open.php

starbuck
02-01-2007, 08:35 PM
Thanks! It works now!