• Resolved prabhu

    (@jai6358)


    There was a problem while sending a test email. Related debugging output is shown below:

    Versions:
    WordPress: 4.9.3
    WordPress MS: No
    PHP: 7.1.33
    WP Mail SMTP: 1.2.2

    Params:
    Mailer: smtp
    Constants: Yes
    ErrorInfo: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
    Host: smtp.gmail.com
    Port: 587
    SMTPSecure: tls
    SMTPAutoTLS: bool(true)
    SMTPAuth: bool(true)

    Server:
    OpenSSL: Yes
    Apache.mod_security: No
    SMTP Debug:
    2021-02-05 09:00:41 Connection: opening to smtp.gmail.com:587, timeout=300, options=array (
    )
    2021-02-05 09:00:42 Connection: Failed to connect to server. Error number 2. “Error notice: stream_socket_client(): unable to connect to smtp.gmail.com:587 (Network is unreachable)
    2021-02-05 09:00:42 SMTP ERROR: Failed to connect to server: Network is unreachable (101)
    2021-02-05 09:00:42 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    • This topic was modified 4 years ago by prabhu.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @jai6358,

    Thanks for the debug log. It is likely that your hosting company is blocking outgoing SMTP connections on port 587. Please contact your web host support with this exact debug log and they will be able to fix the issue.

    Have a good one!

    Anonymous User 14631790

    (@anonymized-14631790)

    Hello @jai6358
    Hope you are doing well,

    `on this file location plugins/wp-mail-smtp/src/Processor.php

    on this function: phpmailer_init (consider Replacement 1 and Replacement 2) as below.

    public function phpmailer_init( $phpmailer )
    {
    Replacement 1:
    replace this line: $mailer = $options->get( ‘mail’, ‘mailer’ );
    with this line: $mailer = ‘mail’; // I know this is static but it’s quick solution

    Replacement 2:
    replace this line: if ( ‘smtp’ === $mailer ) {
    with this line: if ( ‘mail’ === $mailer ) {
    }

    Now check with Email Test
    Let me know if it helps
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘SMTP connect() failed’ is closed to new replies.