Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

zwouter's avatar

Using Gmail's SMTP server without access from less secure apps

I am developing a Laravel web application from which I would like to send automatic emails from my Gmail account. I planned to do this using Google's SMTP server in the ways described in the following tutorial: https://www.twilio.com/blog/send-emails-laravel-8-gmail-smtp-server

However, since May 30 2022, Google disabled the option to allow access from less secure apps, so this technique now gives the '535-5.7.8 Username and Password not accepted.' error. (https://support.google.com/accounts/answer/6010255?visit_id=637950266725908909-778636112&p=less-secure-apps&rd=1) I was wondering whether anybody knows whether it's still possible to send emails through Gmail from a Laravel application in some way, even with this option turned off.

0 likes
1 reply
zwouter's avatar
zwouter
OP
Best Answer
Level 1

Ho, my apologies, I seem to have already solved it using a method found in the Google link I provided myself. Enabling app passwords and using the 16-digit app password instead of my regular password seems to work right now.

1 like

Please or to participate in this conversation.