Search

Using Gmail SMTP Server to send Email in Laravel

post-title

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
MAIL_USERNAME=youremailid@gmail.com
MAIL_PASSWORD=yourpassword
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=youremailid@gmail.com
MAIL_FROM_NAME="${APP_NAME}"

I hope it will help you.