• Resolved unmutedk

    (@unmutedk)


    I keep getting this error when i try to send a test email on WP Mail SMTP, although my configuration is all correct.
    My email hosting company is GoDaddy and the error message says that the reasons could be:

    -Your web server is blocking the connection.
    -Your SMTP host is rejecting the connection.

    So it seems GoDaddy are the one who’s blocking from sending email from WP mail SMTP plugin, so I called their support but they said “no we don’t block any sending SMTP port, so I have no idea why this is happening

    Here is the full Error Log:

    Versions:
    WordPress: 5.5.3
    WordPress MS: No
    PHP: 7.4.11
    WP Mail SMTP: 2.5.1

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

    Server:
    OpenSSL: OpenSSL 1.1.1d 10 Sep 2019
    Apache.mod_security: No

    Debug:
    Mailer: Other SMTP
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    SMTP Debug:
    2020-11-27 14:22:23 Connection: opening to smtpout.secureserver.net:587, timeout=300, options=array()

    2020-11-27 14:22:29 Connection failed. Error #2: stream_socket_client(): unable to connect to smtpout.secureserver.net:587 (Connection refused) [/home/hggl2ztxs2dw/public_html/wp-includes/PHPMailer/SMTP.php line 344]

    2020-11-27 14:22:29 SMTP ERROR: Failed to connect to server: Connection refused (111)

    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @unmutedk,

    Thanks for reaching out. The error suggests that your web server is rejecting the connection to the SMTP host, possibly there’s some firewall blocking outbound SMTP connection. Please provide the full error log to your web host to investigate the issue.

    I hope this helps!

    Anonymous User 14631790

    (@anonymized-14631790)

    Hello @unmutedk @sanzeeb3
    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

    @rohit-savaj Hello, it doesn’t look like either option worked for me. I’m running WP Verison 5.8.1 and the plugin updated at the time of this message. Your first replacement did make the send return a success, and debugging (not very helpful) did say it was a success, however when checking the mail logs or my mail relay server I still never received the email.

    Anonymous User 14631790

    (@anonymized-14631790)

    @danblee have you replaced both replacement 1 and 2?

    Hi @danblee,

    The code posted above by Rohit is not advised.

    If you’re seeing the same error as the original comment on this thread (“stream_socket_client(): unable to connect”), we’ve seen these types of issues resolved by the user’s host providers. To provide your host provider with the right information, you’ll want to share with them the full error log from WP Mail SMTP > Tools.

    You can find the full error details to share with your host provider below the error overview, as shown in this screenshot.

    If your error is different, it’d be best for you to start a new thread so we can best help you.

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WP Mail SMTP: Could not connect to the SMTP host’ is closed to new replies.