Hero Image

Laravel google smtp setup

For this to work you would need also enabling in your google account "Less secure app access". It is under "My Account Page" and "Security". After this, edit .env file and add following:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=587
MAIL_USERNAME=info@replaceme.tld
MAIL_PASSWORD=replaceme
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=info@replaceme.tld
MAIL_FROM_NAME="${APP_NAME}"

The mail_username needs to be e-mail what you have in google. In password field define password what is defined in google mail.

PS! In case you have debug turned on in laravel .env, then turn it off. Otherwise google smtp credentials will leak