Search code examples
phproutesimapwindows-server-2012hmail-server

Connect HmailServer whith PHP imap


I am having two virtual machine: The first is for php pages and web access. The second one contains a hmailServer.

Both are situated in a production environnement and can be accessed via internet and also via local network.

The problem is when i use imap_open in PHP to connect to hmailserver via imap, the time to execute is not stable, from 300 ms to over 4 seconds.

What do you think the problem is

An example

$p=imap_open("ip}INBOX","emailadress","password");
var_dump($p);
imap_close($p);

When i ran this code from an external server, it works and takes always about 300ms.


Solution

  • Problem solved. The local ip address causes the problem and i don't know the reason. I works well when i used the public ip