Using Gmail SMTP Server to send Email in Laravel

  446 views   7 months ago 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}"

I hope it will help you.

Author : Harsukh Makwana
Harsukh Makwana

Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]