Page 1 of 1

imap()

Posted: Sun Nov 03, 2002 3:16 pm
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);

Posted: Sun Nov 03, 2002 4:34 pm
by hob_goblin
Well, are you sure you have IMAP installed?

Posted: Mon Nov 04, 2002 11:51 am
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

Posted: Mon Nov 04, 2002 11:56 am
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)

Posted: Mon Nov 04, 2002 12:59 pm
by DeGauss
Also, if you installed it, did you perchance restart the webserver?

Just a thought.

Posted: Tue Nov 05, 2002 11:03 am
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

Posted: Tue Nov 05, 2002 11:20 am
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...