title: WP Mail SMTP cannot send emails, wrong credentials?
body: <p>I am new to WordPress and I am building a website on localhost using WAMP. I am trying to create a form and send emails when the user submits their information. I am using WP Mail SMTP but I get this error when I try to test it, here are some pictures of the configuration:</p>
  <p><a href="https://i.stack.imgur.com/SHY3H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SHY3H.png" alt="Screenshot of WP Mail SMTP's settings screen" /></a></p>
  <p><a href="https://i.stack.imgur.com/z6Dby.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z6Dby.png" alt="Another screenshot of WP Mail SMTP's settings screen" /></a></p>
  <p>And here's the error message:</p>
  <p><a href="https://i.stack.imgur.com/tKOHG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tKOHG.png" alt="Screenshot of error message when sending out emails" /></a></p>
  <p>My Setup:</p>
  <p>Versions:</p>
  <ul>
  <li>WordPress: 6.0.2</li>
  <li>WordPress MS: No</li>
  <li>PHP: 7.2.18</li>
  <li>WP Mail SMTP: 3.5.2</li>
  </ul>
  <p>Params:</p>
  <ul>
  <li>Mailer: smtp</li>
  <li>Constants: No</li>
  <li>ErrorInfo: SMTP Error: Could not authenticate.</li>
  <li>Host: smtp.gmail.com</li>
  <li>Port: 465</li>
  <li>SMTPSecure: ssl</li>
  <li>SMTPAutoTLS:
  C:\wamp64\www\testing_wordpress\wp-content\plugins\wp-mail-smtp\src\Debug.php:188:boolean false</li>
  <li>SMTPAuth:
  C:\wamp64\www\testing_wordpress\wp-content\plugins\wp-mail-smtp\src\Debug.php:188:boolean true</li>
  </ul>
  <p>Server:</p>
  <ul>
  <li>OpenSSL: OpenSSL 1.1.1b 26 Feb 2019</li>
  <li>Apache.mod_security: No</li>
  </ul>
  <p>Debug:</p>
  <ul>
  <li>Email Source: WP Mail SMTP</li>
  <li>Mailer: Other SMTP</li>
  <li>SMTP Error: Could not authenticate.</li>
  </ul>
  <p>SMTP Debug:</p>
  <blockquote>
  <p>2022-09-07 14:42:56 Connection: opening to ssl://smtp.gmail.com:465,
  timeout=300, options=array()</p>
  <p>2022-09-07 14:42:58 Connection: opened</p>
  <p>2022-09-07 14:42:58 SERVER -&gt; CLIENT: 220 smtp.gmail.com ESMTP
  y16-20020a05600c365000b003a62bc1735asm19424859wmq.9 - gsmtp</p>
  <p>2022-09-07 14:42:58 CLIENT -&gt; SERVER: EHLO localhost</p>
  <p>2022-09-07 14:42:58 SERVER -&gt; CLIENT: 250-smtp.gmail.com at your
  service, [129.45.33.42]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN
  PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER
  XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8</p>
  <p>2022-09-07 14:42:58 CLIENT -&gt; SERVER: AUTH LOGIN</p>
  <p>2022-09-07 14:42:58 SERVER -&gt; CLIENT: 334 VXNlcm5hbWU6</p>
  <p>2022-09-07 14:42:58 CLIENT -&gt; SERVER: [credentials hidden]</p>
  <p>2022-09-07 14:42:59 SERVER -&gt; CLIENT: 334 UGFzc3dvcmQ6</p>
  <p>2022-09-07 14:42:59 CLIENT -&gt; SERVER: [credentials hidden]</p>
  <p>2022-09-07 14:42:59 SERVER -&gt; CLIENT: 535-5.7.8 Username and Password
  not accepted. Learn more at535 5.7.8
  <a href="https://support.google.com/mail/?p=BadCredentials" rel="nofollow noreferrer">https://support.google.com/mail/?p=BadCredentials</a>
  y16-20020a05600c365000b003a62bc1735asm19424859wmq.9 - gsmtp</p>
  <p>2022-09-07 14:42:59 SMTP ERROR: Password command failed: 535-5.7.8
  Username and Password not accepted. Learn more at535 5.7.8
  <a href="https://support.google.com/mail/?p=BadCredentials" rel="nofollow noreferrer">https://support.google.com/mail/?p=BadCredentials</a>
  y16-20020a05600c365000b003a62bc1735asm19424859wmq.9 - gsmtp</p>
  <p>SMTP Error: Could not authenticate.</p>
  <p>2022-09-07 14:42:59 CLIENT -&gt; SERVER: QUIT</p>
  <p>2022-09-07 14:43:00 SERVER -&gt; CLIENT: 221 2.0.0 closing connection
  y16-20020a05600c365000b003a62bc1735asm19424859wmq.9 - gsmtp</p>
  <p>2022-09-07 14:43:00 Connection: closed</p>
  <p>SMTP Error: Could not authenticate.</p>
  </blockquote>