Text obtained from imap_open not printing to browser

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
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

Text obtained from imap_open not printing to browser

Post 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,
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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);
impulse()
Forum Regular
Posts: 748
Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:

Post 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,
Post Reply