Enable Two factor verification to Send Email using SMTP in laravel

Follow the below steps to setup email

1. Login to Gmail
2. click on user icon on top right nad select "Manage your Google Account"
3. click on security from left menu
4. turn "on" 2-step verification.
5. click on "App passwords"
6. Under your app passords select "Other" and give your application name
7. Click on "Generate"
8. Now it will display 16 character password. copy this password and keep it safe. As afterwards you will not be able to see it.
9. Edit .env file as follows

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=yourpassword
MAIL_ENCRYPTION=ssl
[email protected]
MAIL_FROM_NAME="${APP_NAME}"

 

Tags: