我在使用PHPMailer发送电子邮件时遇到麻烦,服务器中的代码是下一个:
$Email = new PHPMailer();
$Email->isSMTP();
$Email->Host = "smtp.gmail.com";
$Email->SMTPDebug = 1;
$Email->SMTPAuth = true;
$Email->SMTPSecure = "tls";
$Email->Host = "smtp.gmail.com";
$Email->Port = 587;
$Email->Username = "noreply@MyMailService";
$Email->Password = "myPassword";
$Email->setFrom("noreply@MyMailService", "EnterpriseName");
$Email->Subject = $mensaje["destiny"];
$Email->AddAddress($mensaje["destiny"], "");
$Email->MsgHTML($mensaje["mensaje"]);
if(!$Email->send()){
echo "Error sending: " . $Email->ErrorInfo;
}else{
echo "E-mail sent";
}
所以,当我用Postman测试它时会出现这个错误:
编辑:已删除图片
邮件主机是为托管服务提供的邮件主机,所以我不知道,我不确定问题是否与$Email->Host
有关,我怎样才能获得该参数?