Home >Backend Development >PHP Tutorial >How to Resolve \'Expected Response Code 250 but Got Code 535\' SMTP Authentication Error?
Expected Response Code 250 but Received Code 535: Resolving SMTP Authentication Error
Upon attempting to send an email via SMTP through Gmail using SwiftMail, an error occurred indicating "Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted." This error stems from an authentication issue with the provided credentials.
To address this, enabling "access for lesser apps" and unlocking the Gmail captcha did not provide a resolution. However, implementing 2-step verification and creating an app password proved successful.
Solution:
After these steps, the email sending functionality should be restored. This solution eliminates the authentication error by utilizing a dedicated app password that grants access to your Gmail account.
The above is the detailed content of How to Resolve 'Expected Response Code 250 but Got Code 535' SMTP Authentication Error?. For more information, please follow other related articles on the PHP Chinese website!