我希望能夠通過office365在
Hostgator發送郵件.我能用gmail做到這一點,但無法将其設定為使用office365.
它适用于我的其他兩台伺服器,我很好.唯一的問題是Hostgator.
他們必須采取一些行動嗎?
require_once('class.phpmailer.php');
$mail = new PHPMailer(true);
$mail->IsSMTP();
$mail->SMTPDebug = 2;
$mail->SMTPAuth = true;
$mail->SMTPSecure = "tls";
$mail->Host = "pod51014.outlook.com";
$mail->Port = 587;
$mail->Username = "usernamehere";
$mail->Password = "************";
$mail->Send();
?>
我隻是不斷得到以下回應:
SMTP -> ERROR: Failed to connect to server: Connection refused (111)
我在與他們的支援聊天,587端口應該打開.