• Resolved useStrict

    (@usestrict)


    Hi,

    I’m trying to set up WP Mail SMTP with a new SMTP server and keep getting authentication failure. I contacted the sysadmin and he said the following:

    It is trying to use CRAM authentication, which won’t work. You need to use either PLAIN or LOGIN.

    Is there a way to set the type of authentication? Here is the full error log:

    Versions:
    WordPress: 5.8.1
    WordPress MS: No
    PHP: 7.4.23
    WP Mail SMTP: 3.0.3
    
    Params:
    Mailer: smtp
    Constants: No
    ErrorInfo: SMTP Error: Could not authenticate.
    Host: ***ipp.com
    Port: 587
    SMTPSecure: tls
    SMTPAutoTLS: bool(true)
    SMTPAuth: bool(true)
    
    Server:
    OpenSSL: OpenSSL 1.1.0l  10 Sep 2019
    
    Debug:
    Email Source: WP Mail SMTP
    Mailer: Other SMTP
    SMTP Error: Could not authenticate.
    
    SMTP Debug:
    
    2021-09-21 15:45:45 Connection: opening to ***ipp.com:587, timeout=300, options=array()
    
    2021-09-21 15:45:46 Connection: opened
    
    2021-09-21 15:45:46 SERVER -> CLIENT: 220 allegro.isipp.com ESMTP Sendmail 8.15.2/8.15.2/Debian-8+deb9u1; Tue, 21 Sep 2021 15:45:46 GMT; (No UCE/UBE) logging access from: [x.x.x.x](FORGED)-x.x.x.x.vultr.com [x.x.x.x.x] (may be forged)
    
    2021-09-21 15:45:46 CLIENT -> SERVER: EHLO ***.com
    
    2021-09-21 15:45:46 SERVER -> CLIENT: 250-***ipp.com Hello 216.128.149.225.vultr.com [216.128.149.225] (may be forged), pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING250-EXPN250-VERB250-8BITMIME250-SIZE250-DSN250-AUTH DIGEST-MD5 CRAM-MD5250-STARTTLS250-DELIVERBY250 HELP
    
    2021-09-21 15:45:46 CLIENT -> SERVER: STARTTLS
    
    2021-09-21 15:45:46 SERVER -> CLIENT: 220 2.0.0 Ready to start TLS
    
    2021-09-21 15:45:46 CLIENT -> SERVER: EHLO ***.com
    
    2021-09-21 15:45:46 SERVER -> CLIENT: 250-***ipp.com Hello x.x.x.x.vultr.com [216.128.149.225] (may be forged), pleased to meet you250-ENHANCEDSTATUSCODES250-PIPELINING250-EXPN250-VERB250-8BITMIME250-SIZE250-DSN250-AUTH DIGEST-MD5 CRAM-MD5 LOGIN PLAIN250-DELIVERBY250 HELP
    
    2021-09-21 15:45:46 CLIENT -> SERVER: AUTH CRAM-MD5
    
    2021-09-21 15:45:46 SERVER -> CLIENT: 334 PDE1NTg5NDg4NDcuNDg0OTI5MUBhbGxlZ3JvLmlzaXBwLmNvbT4=
    
    2021-09-21 15:45:46 CLIENT -> SERVER: [credentials hidden]
    
    2021-09-21 15:45:46 SERVER -> CLIENT: 535 5.7.0 authentication failed
    
    2021-09-21 15:45:46 SMTP ERROR: Username command failed: 535 5.7.0 authentication failed
    
    SMTP Error: Could not authenticate.
    
    2021-09-21 15:45:46 CLIENT -> SERVER: QUIT
    
    2021-09-21 15:45:46 SERVER -> CLIENT: 221 2.0.0 ***ipp.com closing connection
    
    2021-09-21 15:45:46 Connection: closed
    
    SMTP Error: Could not authenticate.

    Cheers,
    Vinny

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter useStrict

    (@usestrict)

    I found a solution:

    add_filter( 'wp_mail_smtp_custom_options', function( $phpmailer ) {
        $phpmailer->AuthType = 'LOGIN';
    
        return $phpmailer;
    } );

    It’d be nice if there were a simpler way to test that, or if the plugin could cycle through the options when something fails.

    I found a solution:
    
    add_filter( 'wp_mail_smtp_custom_options', function( $phpmailer ) {
        $phpmailer->AuthType = 'LOGIN';
    
        return $phpmailer;
    } );

    Where to put this line?

    • This reply was modified 4 years, 8 months ago by tico87.

    @usestrict
    Where to put this line?

    Hi @tico87,

    You can check out the documentation on ways to add custom code snippets in your site.

    However, it is probably not the same error you’re getting. If that does not fix the issue, please create a new support post with the SMTP error.

    @usestrict – WordPress (PHPMailer) uses these auth types in order:

    CRAM-MD5, LOGIN, PLAIN, XOAUTH2

    But if the receiving SMTP server is not configured correctly, it will fail at the first one.

    I hope this clarifies!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Authentication error’ is closed to new replies.