• Resolved aliamrezaie

    (@aliamrezaie)


    I’ve tested three mail options of this plugin, and every time I try to send a test email I get this error: “Could not connect to the SMTP host.”
    I tested my own Cpanel mail server, yahoo SMTP servers, and Sendinblue. using all of them gave me the same error.
    I even thripple checked the settings.
    could you help me, please?

    • This topic was modified 5 years, 3 months ago by aliamrezaie.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @aliamrezaie,

    Please share a full error log recorded when you send a test email from WP Mail SMTP > Email Test? Here’s a screenshot for the option to get a full error log. This will give us an idea of what might be going on.

    Likely is outbound SMTP connection is blocked by some firewall in your server.

    Thanks!

    Thread Starter aliamrezaie

    (@aliamrezaie)

    Thanks for your response Sanjeev.
    here is the full error log:

    `Versions:
    WordPress: 5.6.2
    WordPress MS: No
    PHP: 5.6.40
    WP Mail SMTP: 2.6.0

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

    Server:
    OpenSSL: OpenSSL 1.0.2u 20 Dec 2019

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

    SMTP Debug:
    2021-03-02 01:03:24 Connection: opening to smtp.mail.yahoo.com:587, timeout=300, options=array()

    2021-03-02 01:03:25 Connection failed. Error #2: stream_socket_client(): unable to connect to smtp.mail.yahoo.com:587 (Connection refused) [/home/atsgroup/public_html/wp-includes/PHPMailer/SMTP.php line 381]

    2021-03-02 01:03:25 SMTP ERROR: Failed to connect to server: Connection refused (111)

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

    I hope this problem could solve soon.

    Hi @aliamrezaie,

    Thanks for the error log. That indicates outbound SMTP connection is blocked by some firewall in your server. Please contact your web host and ask them to open the blocked SMTP port. You might want to try using port 465 and SSL encryption.

    Have a good one!

    Anonymous User 14631790

    (@anonymized-14631790)

    Hello @aliamrezaie
    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
    • This reply was modified 5 years ago by Anonymous User 14631790. Reason: to help
    • This reply was modified 5 years ago by Anonymous User 14631790.
    Anonymous User 14631790

    (@anonymized-14631790)

    Hello @aliamrezaie
    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 5 replies - 1 through 5 (of 5 total)

The topic ‘Problem with connecting to any server’ is closed to new replies.