How to Allow gmail less secure apps for send mail – Developersmap.com
if you want to send mail in your website like cakephp , laravel, core php or other freamwork and you are facing some error like “failed to authenticate on smtp server with username” this. and you can use below code it will very helpfull for you.
Use Code :
1. Go to gmail and login your account. 2. then please hit this url https://myaccount.google.com/security#connectedapps 3. then find Sign-in & security -> Apps with account access menu. You must enable the option "Allow less secure apps" ON. 4. after this please hit this url https://accounts.google.com/UnlockCaptcha. 5. after this please enable and click continue and unlock your account for access through other media/sites for gmail. 6. then use your gmail function it will work and remove that error.