提问人:imvain2 提问时间:10/17/2023 最后编辑:imvain2 更新时间:10/17/2023 访问量:49
PHPMailer:无法连接到 SMTP 主机。连接失败。stream_select()
PHPMailer: Could not connect to SMTP host. Connection failed. stream_select()
问:
我搜索了 SO 并测试了所有各种设置更改,但找不到问题的解决方案。
服务器:Windows 服务器 2019 - IIS 10
PHP格式:PHP 5.6(是的,我知道它已经过时了,但我被迫在所有服务器完全关闭之前没有时间大修一堆代码)。
PHP机器版本: 6.8.1
SMTP错误:无法连接到 SMTP 主机。连接失败。stream_select():无法选择 [11]:资源暂时不可用 (max_fd=656) 无法发送消息。邮件
我在Classic ASP for SMTP中尝试了相同的登录详细信息,它起作用了,所以我知道SMTP信息是正确的。
$mail = new PHPMailer(true);
$mail->SMTPDebug = 1;
$mail->isSMTP();
$mail->Host = "myHost";
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "passWord";
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //even tried "ssl" and "tls"
$mail->Port = "465"; //465/587
$mail->XMailer = ' ';
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
错误日志:
2023-10-16 19:17:44 Connection: opening to ssl://smtp.example.com:465, timeout=300, options=array()
2023-10-16 19:17:44 Connection: opened
2023-10-16 19:17:44 Connection failed. Error #2: stream_select(): unable to select [11]: Resource temporarily unavailable (max_fd=764) [SMTP.php line 1238]
2023-10-16 19:17:44 SERVER -> CLIENT:
2023-10-16 19:17:44 Connection: closing due to error
2023-10-16 19:17:44 Connection: closed
SMTP Error: Could not connect to SMTP host. Connection failed. stream_select(): unable to select [11]: Resource temporarily unavailable (max_fd=764)
Message could not be sent.Mailer Error: SMTP Error: Could not connect to SMTP host. Connection failed. stream_select(): unable to select [11]: Resource temporarily unavailable (max_fd=764)SMTP server error: Connection failed. Detail: stream_select(): unable to select [11]: Resource temporarily unavailable (max_fd=764) SMTP code: 2
答: 暂无答案
评论
SMTPDebug
Port
stream_select