Use this test script to check if you are really able to connect from hosting server:
<?php
function test_connection($username,$password,$imap_host,$imap_port,$prot){
if(function_exists("imap_open")){
if($prot){
$imap_open = "{" . $imap_host . ":" . $imap_port . "/imap/" . $prot . "/novalidate-cert}INBOX";
}
else{
$imap_open = "{" . $imap_host . ":" . $imap_port . "/novalidate-cert}INBOX";
}
if($res = @imap_open($imap_open, $username, $password)){
$success = true;
imap_close($res);
}
else{
$success = false;
}
}
else{
$success = true;
}
return $success;
}
// DO NOT EDIT
if(test_connection("demo@mail4us.net","demo","mail4us.net",143,false))
echo "mail4us.net ok
";
else
echo "mail4us.net failed
";
//EDIT USER AND PASSWORD
if(test_connection("mygoogleaccount@gmail.com","mygooglepassword","imap.gmail.com",993,"ssl"))
echo "ssl google ok
";
else
echo "ssl google failed
";
?>