The response code was expected to be 250, but instead 535 was received, and the message was "535-5.7.8 Username and password not accepted"
P粉510127741
P粉510127741 2023-08-21 23:19:07
0
2
550
<p>I recently encountered a SwiftMail error while trying to send an email through gmail. </p> <pre class="brush:php;toolbar:false;">Expected response code 250, but received code "535" with message "535-5.7.8 Username and password not accepted." /pre> <p>I tried sending an email through my gmail and Google thought I was spam (probably because I requested too quickly) and they sent me an email saying my account was accessed, which I told them it was I operated it myself. I was able to send emails without issue, I just now have this problem. </p> <p>This is the content of my env file. </p> <pre class="brush:php;toolbar:false;">MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=talentscoutphil@gmail.com MAIL_PASSWORD=mypasswordhere MAIL_FROM=talentscoutphil@gmail.com MAIL_NAME=talentscout</pre> <p><br /></p>
P粉510127741
P粉510127741

reply all(2)
P粉450079266

I had the same problem, changing my gmail password solved the problem, also don't forget to enable Insecure Applications on your gmail account

P粉937382230

I researched on the internet and some of the answers included enabling "Lower App Access" and "Unlocking gmail verification code" but unfortunately didn't work for me Worked until I found two-step verification.

What I did was:

  1. To enable two-step verification on Google, click here

  2. To create an application password for system use, click here

  3. I selected Other (custom name) and clicked Generate

  4. Go into my laravel environment file and edit it

    MAIL_USERNAME=talentscoutphil@gmail.com

    MAIL_PASSWORD=Generated password

  5. Restarted my Apache server and it worked again.

This is my solution. I created this solution to at least save others from wasting time looking for possible answers.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!