class Imap { private $host = 'imap.mail.ru'; private $port = 993; private $login = 'tmp@mail.ru'; private $pass = '1111'; private $param = '/imap/ssl/novalidate-cert'; private $folder = 'INBOX'; public function connect() { if ($mbox = imap_open("{" . "{$this->host}:{$this->port}{$this->param}" . "}$this->folder", $this->login, $this->pass)) { echo "Connected"; } else { exit ("Can't connect: " . imap_last_error() . "n"); echo "FAIL!n"; }; } } $mail = new Imap(); $mail->connect();
Результат:
Warning: imap_open(): Couldn't open stream {imap.mail.ru:993/imap/ssl/novalidate-cert}INBOX in /home/wonder-bug/public_html/include/developers/imap/Imap.php on line 22 Can't connect: Unable to create selectable TCP socket (1668 >= 1024)n
На своем сервере код отрабатывает без проблем.