Call to undefined function imap_open()

Hello,

I have a problem with php_imap to retrieve e-mail data.
I did not find the solution in scriptcase forum.

Code is like that:
$domain = “yourdomain.com”;
$servSmtp = “smtp.”.$domain;
$port = “143”."/novalidate-cert";
$user = “youremail”."@".$dom;
$pass = “yourpassword”;
$con = “{”.gethostbyname($servSmtp).":".$port."}INBOX";
// $con = chr(123).gethostbyname($servSmtp).":".$port.chr(125).“INBOX”;

$mail_box = imap_open($con, $user, $pass);
echo imap_num_msg($mail_box);

Just a simply code in a blank return this error: “Call to undefined function imap_open()”
There’s a way to add external librarys or something?

Hello Takeo,
your problem regarding the undefined function imap_open() is not a Scriptcase problem at all.

In fact PHP on the server you’re running Scriptcase on does not support this functionality.

If you run a simple php script with the phpinfo() function it will show you, if the imap extension is installed.
On my server it shows somewhere:

Please refer to your server PHP and you may read:
https://www.php.net/manual/en/imap.setup.php

Hope this helps.

Sincerely
Gunter Eibl
Scriptcase coach
https://asdw.de

1 Like

Thanks GunterEibl,

I didn’t know that.
Just contacted the infrastructure to setup the imap.

I inform you here if it works.

Thanks again.