このコードは私の国エジプトで正常に機能しており、英国にあるサーバーにアップロードするたびに機能しません。国の認証の問題のようです。Hotmail の設定であっても、この制限を克服する方法はありますか
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();
エジプトでは戻り値: CONNECTED 戻り値として英国では、エコー imap_last_error(); として接続に失敗しました。次のメッセージを返します: IMAP サーバーに認証できません: [AUTHORIZATIONFAILED] アカウントがブロックされました。Web ブラウズでアカウントにログイン