First, you need to create an App Password from your Google Account:
Go to your Google Account: https://myaccount.google.com/
Click on "Security" in the left menu
Enable "2-Step Verification" if not already enabled
Go back to Security → 2-Step Verification
Scroll down to "App passwords"
Select "Mail" and "Other (Custom name)"
Enter a name like "Laravel App"
Click "Generate"
Copy the 16-character password (no spaces)
Update .env file with the following info:
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-16-char-app-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="your-email@gmail.com"
MAIL_FROM_NAME="${APP_NAME}"
No comments:
Post a Comment