Email Configuration
Set up email sending for notifications and verification.
Reward Loyalty sends emails for registration, password resets, and notifications. Configure your email provider in the .env file.
Configuration
Locate the mail section in your .env file:
MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="hello@yourdomain.com"
MAIL_FROM_NAME="${APP_NAME}"
Common Providers
SMTP (General)
MAIL_MAILER=smtp
MAIL_HOST=your-smtp-server.com
MAIL_PORT=587
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
Gmail
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your@gmail.com
MAIL_PASSWORD=your_app_password
MAIL_ENCRYPTION=tls
Note: Gmail requires an App Password, not your regular password. Enable 2FA and generate an App Password in your Google account settings.
Mailgun
MAIL_MAILER=mailgun
MAILGUN_DOMAIN=your-domain.mailgun.org
MAILGUN_SECRET=your-api-key
Spam Prevention
If registration emails land in spam:
- Check your domain's SPF and DKIM records
- Use a reputable email provider
- Avoid spam trigger words in email content
Registration Link Setting
Long URLs in registration emails may trigger spam filters. If you have deliverability issues:
APP_REGISTRATION_EMAIL_LINK=false
This disables the automatic login link in registration emails.
Testing
After configuring, test email sending:
- Register a new test account
- Check if the verification email arrives
- Verify it doesn't land in spam
Troubleshooting
Emails not sending:
- Verify credentials are correct
- Check your provider's sending limits
- Review
storage/logs/laravel.logfor errors
Emails in spam:
- Configure SPF/DKIM records
- Use a dedicated sending domain
- Consider a transactional email service