mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-27 01:28:56 +08:00
19 lines
357 B
PHP
19 lines
357 B
PHP
|
<?php
|
||
|
|
||
|
// simple connection test
|
||
|
|
||
|
$host = 'imap.gmail.com';
|
||
|
$port = 993;
|
||
|
|
||
|
echo $host.':'.$port;
|
||
|
|
||
|
$errorStr = '';
|
||
|
$errorNo = 0;
|
||
|
|
||
|
$connection = stream_socket_client($host.':'.$port, $errorNo, $errorStr, 5, STREAM_CLIENT_CONNECT);
|
||
|
if (is_resource($connection)) {
|
||
|
echo ' = OK';
|
||
|
fclose($connection);
|
||
|
} else {
|
||
|
echo ' = ERROR ([#'.$errorNo.'] '.$errorStr.')';
|
||
|
}
|