First you need to activate 2-Step Verification and create app password. I am writing below how to do it step by step:
- Login to your gmail account.
- Click your image on top right corner.
- Click "Manage your Google Account"
- Go to the "Security" tab
- Set "2-Step Verification" On. (I don't want to explain how to set 2-step verification, I'm sure it is easy step for you)
- Click "App passwords", confirm your password.
- on "Select App" choose "Mail" and on "Select device" choose "Other (Custom Name)" and write "Laravel" or whatever you want, then generate.
- Copy your App password.
Open laravel ".env" file and change these variables:
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your_username@gmail.com
MAIL_PASSWORD=your_gmail_app_password
MAIL_ENCRYPTION=tls
That is it, hope it will help you.
Setup smtp mail config using gmail in Laravel
#laravel gmail smtp
#laravel smtp error
#laravel gmail send email
#laravel gmail smtp config
#laravel send email
Rashad Mirza
Nov 25, 2020
Rashad Mirza
Lead senior developer, who spends his day by developing, tutoring and learning new languages
DEVELOPING
Since 2004
More posts
#Laravel
#Laravel Migration
#Laravel database
#Laravel Textarea
#nl2br
#Laravel blade textarea
#Textarea html laravel
#Laravel
#Laravel DebugBar
#Laravel testing
#Vue
#Vue.js
#Vuex
#Make Vuex state persistent
#Php artisan
#Laravel
#Laravel commands
#Migration