Send emails in Laravel using Gmail SMTP
8 September 2024 (Updated 8 September 2024)
Generate an App password for your Google account:
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