This code working fine in my country Egypt how every when i upload it to the server which is located in UK it does not work, it seems to be a country authentication problem. Is there any way to over come this restriction even if in Hotmail settings
class Hotmail {
private $_email;
private $_password;
private $_host = "{imap-mail.outlook.com:993/ssl}Inbox";
public function __construct($email, $password) {
$this->_email = $email;
$this->_password = $password;
}
public function authenticate() {
if ($mbox = imap_open($this->_host, $this->_email, $this->_password)) {
$imap_obj = imap_check($mbox);
echo "<h1>CONNECTED TO IMAP HOST</h1><h2>$this->_host (" . $imap_obj->Nmsgs . ")<h2>";
} else {
echo imap_last_error();
echo "<h1>FAILED TO CONNECT TO IMAP HOST!</h1>\n";
die;
}
echo "<h3>IMAP LIST OF FOLDERS</h3>";
$folders = imap_list($mbox, $this->_host, "*");
echo "<ul>";
foreach ($folders as $folder) {
echo '<li><a href="mail.php?folder=' . $folder . '&func=view">' . imap_utf7_decode($folder) . '</a></li>';
}
echo "</ul>";
imap_close($mbox);
}
}
$hotmail = new Hotmail('sahar_24@outlook.com', '01277217631!');
$hotmail->authenticate();
In Egypt in returns: CONNECTED In UK in return FAILED TO CONNECT as echo imap_last_error(); return the following message: Can not authenticate to IMAP server: [AUTHORIZATIONFAILED] Account is blocked. Login to your account via a web browse