imap()

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
jamal
Forum Commoner
Posts: 57
Joined: Sat Oct 26, 2002 7:53 pm
Location: London

imap()

Post by jamal »

Hi
can anyone help me please. Everytime I tried to execute the
file below I get the error message:
"Call to undefined function: imap_open() "

Code: Select all

$mbox = imap_open ("{my.imap.host}INBOX","myusername","mypassword") || 
die ("can't connect: " . imap_last_error()); 
$check = imap_check ($mbox); 
if($check) { 
print "Date: " . $check->Date . "\n" ; 
print "Driver: " . $check->Driver . "\n" ; 
print "Mailbox: " . $check->Mailbox . "\n" ;
print "Messages: " . $check->Nmsgs . "\n" ; 
print "Recent: " . $check->Recent . "\n" ; 
 } 
 else { 
 print "imap_check() failed: " . imap_last_error() . "\n"; 
 } 
 imap_close ($mbox);
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

Well, are you sure you have IMAP installed?
jamal
Forum Commoner
Posts: 57
Joined: Sat Oct 26, 2002 7:53 pm
Location: London

Post by jamal »

i tried to have imap() installed but it proved abortive. Please can you help me on it.
I uncommeted the imap.dll in the php.ini file. And I have the imap.dll installed where php was installed. But all this did not work.
Is there any help??
Jamal
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Code: Select all

<?php phpinfo(); ?>
tells you about available extensions.
If you uncomment extension=php_imap.dll in php.ini and the library can't be loaded there should be an error message either as message box or in the server's error-log (depending on OS and webserver)
DeGauss
Forum Contributor
Posts: 105
Joined: Tue Oct 22, 2002 9:44 am
Location: Gainesville, FL

Post by DeGauss »

Also, if you installed it, did you perchance restart the webserver?

Just a thought.
jamal
Forum Commoner
Posts: 57
Joined: Sat Oct 26, 2002 7:53 pm
Location: London

Post by jamal »

I could not be able to restart the server. I use win98. I have got no problem with php or the apache. I use mail() without a problem as well. But the problem is only with imap_open().
Is there any further help??
thanks
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Code: Select all

<?php phpinfo(); ?>
tells you the path of the used php.ini
e.g. my phpinfo tells me
...
Virtual Directory Support enabled
Configuration File (php.ini) Path C:\WINNT\php.ini
Debug Build no
...
did you change values in the right php.ini?
Also, if you installed it, did you perchance restart the webserver?
the webserver software (Apache,PWS) was meant...
Post Reply