Page 1 of 1

Text obtained from imap_open not printing to browser

Posted: Fri Nov 24, 2006 9:54 am
by impulse()
Hello.

I have the following code:

Code: Select all

$mbox = imap_open("{x:110/pop3}INBOX", "x", "x");
$body = imap_body($mbox, 1);
print $body;
imap_close($mbox);
If I run this script from a shell I can view the contents of the body for the e-mail but if I run this through a browser I get no HTML returned. If I echo a step number for each line of code it seems to stop printing output on the line

Code: Select all

$mbox = imap_open("{x:110/pop3}INBOX", "x", "x");
Can anyone shed some light on to what's going wrong here?

Regards,

Posted: Fri Nov 24, 2006 10:19 am
by Chris Corbyn
The CLI binary has been compiled with IMAP support whereas the CGI or .so version has not?

EDIT | Trun on full error reporting if it's not already on.

Posted: Fri Nov 24, 2006 11:33 am
by volka
d11wtq wrote:EDIT | Trun on full error reporting if it's not already on.
And add a test wether the imap extension is available or not

Code: Select all

error_reporting(E_ALL);
ini_set('display_errors', true);

if ( !extension_loaded('imap') ) {
	die('imap extension not present');
}

$mbox = imap_open("{x:110/pop3}INBOX", "x", "x") or die('imap_open failed');
$body = imap_body($mbox, 1);
print $body;
imap_close($mbox);

Posted: Fri Nov 24, 2006 11:40 am
by impulse()
imap extension not present
Is this server or client side?


** Edit

^ Stupid question I know. I'll have a look into installing the imap extensions.

Regards,