Send emails in Laravel using Gmail SMTP
8 September 2024 (Updated 8 September 2024)
Generate an App password for your Google account:
![](https://sajadtorkamani.com/wp-content/uploads/2024/09/CleanShot-2024-09-08-at-15.02.43.png)
![](https://sajadtorkamani.com/wp-content/uploads/2024/09/CleanShot-2024-09-08-at-15.03.22-1024x446.png)
![](https://sajadtorkamani.com/wp-content/uploads/2024/09/image-6.png)
![](https://sajadtorkamani.com/wp-content/uploads/2024/09/image-7.png)
Update your .env
file:
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=<your-gmail-address>
MAIL_PASSWORD="<your-app-password>"
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=<your-gmail-password>
MAIL_FROM_NAME="${APP_NAME}"
Send a test email and verify the recipient receives it. Make sure to check junk/spam folder if not in inbox.
Tagged:
Laravel