imvain2
imvain2

Reputation: 15847

PHPMailer: Could not connect to SMTP host. Connection failed. stream_select()

I searched through SO and tested all of the various settings changes and couldn't find the solution to the problem.

Server: Windows Server 2019 - IIS 10

PHP: PHP 5.6 (yes I know its outdated but I'm forced in a situation where I don't have the time to overhaul a bunch of code before all servers are completely shut down).

PHPMailer Version: 6.8.1

SMTP Error: Could not connect to SMTP host. Connection failed. stream_select(): unable to select [11]: Resource temporarily unavailable (max_fd=656) Message could not be sent.Mailer

I tried the same login details in Classic ASP for SMTP and it worked so I know the SMTP information is correct.

    $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
        )
    );

ERROR LOG:

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

Upvotes: 0

Views: 200

Answers (0)

Related Questions