Email / SMTP Setup
FeedbackPulse sends various transactional emails. Proper email configuration is important for:
- Welcome emails to new tenants
- Team invitation links
- Password reset emails
- Email OTP verification (for feedback forms)
- Daily/weekly digests
- Scheduled reports
- Usage alerts
- Plan change notifications
โ๏ธ Configuration Methodsโ
Method 1: Via Admin Panel (Recommended)โ
- Log in as superadmin
- Go to Admin โ Settings โ Email
- Fill in your SMTP details
- Click Send Test Email to verify
- Save
Method 2: Via .env Fileโ
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME="FeedbackPulse"
๐ฎ Provider-Specific Setupโ
๐ง Gmailโ
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=your_app_password
MAIL_ENCRYPTION=tls
โ ๏ธ Important: Gmail requires an App Password, not your regular password.
- Go to Google Account Security
- Enable 2-Step Verification (required)
- Go to App passwords โ select "Mail" โ generate
- Use the generated 16-character password
๐ด Gmail limits: 500 emails/day (personal) or 2,000/day (Workspace). Not recommended for production SaaS.
๐ซ Mailgunโ
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=your_mailgun_smtp_password
MAIL_ENCRYPTION=tls
- Sign up at Mailgun
- Add your domain โ verify DNS records
- Go to Sending โ Domain Settings โ SMTP credentials
- Copy the SMTP password
๐ฆ Amazon SESโ
MAIL_HOST=email-smtp.us-east-1.amazonaws.com
MAIL_PORT=587
MAIL_USERNAME=your_ses_smtp_username
MAIL_PASSWORD=your_ses_smtp_password
MAIL_ENCRYPTION=tls
- Go to AWS SES Console
- Verify your domain
- Go to SMTP Settings โ Create SMTP Credentials
- Move out of sandbox mode for production
๐จ SendGridโ
MAIL_HOST=smtp.sendgrid.net
MAIL_PORT=587
MAIL_USERNAME=apikey
MAIL_PASSWORD=your_sendgrid_api_key
MAIL_ENCRYPTION=tls
๐ก Note: The username is literally
apikey(not your email). The password is your SendGrid API key.
โ๏ธ Postmarkโ
MAIL_HOST=smtp.postmarkapp.com
MAIL_PORT=587
MAIL_USERNAME=your_postmark_server_api_token
MAIL_PASSWORD=your_postmark_server_api_token
MAIL_ENCRYPTION=tls
๐ต ZOHO Mailโ
MAIL_HOST=smtp.zoho.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=your_zoho_password
MAIL_ENCRYPTION=tls
๐งช Mailtrap (Testing Only!)โ
MAIL_HOST=sandbox.smtp.mailtrap.io
MAIL_PORT=587
MAIL_USERNAME=your_mailtrap_username
MAIL_PASSWORD=your_mailtrap_password
MAIL_ENCRYPTION=tls
โ ๏ธ Mailtrap is for development/testing only. Emails are captured in your Mailtrap inbox and never delivered to real recipients.
๐งช Testing Emailโ
Via Admin Panelโ
- Go to Admin โ Settings โ Email
- Click Send Test Email
- Check your inbox
Via Command Lineโ
php artisan tinker
Mail::raw('Test email from FeedbackPulse', function ($message) {
$message->to('[email protected]')->subject('SMTP Test');
});
๐จ Emails Sent by FeedbackPulseโ
| When | Recipient | |
|---|---|---|
| Welcome | New tenant registers | Tenant admin |
| Team Invitation | Admin invites team member | Invitee email |
| Plan Changed | Subscription changes | Tenant admin |
| New Submission Alert | New feedback received | Tenant admin/staff |
| Email Digest | Daily/weekly schedule | Tenant admin |
| Scheduled Report | Daily/weekly/monthly | Tenant admin |
| Usage Alert | 90%+ of plan limit | Tenant admin |
| Password Reset | User requests reset | Requesting user |
| Email Verification | New registration | New user |
| OTP Code | Feedback form with OTP | End user submitting feedback |
๐ Troubleshooting Emailโ
| Issue | Solution |
|---|---|
| Emails not sending | Check .env SMTP settings. Try MAIL_MAILER=log to test without SMTP. Check storage/logs/laravel.log. |
| Emails going to spam | Add SPF, DKIM, and DMARC records to your domain's DNS. Use a reputable SMTP provider. |
| "Connection timed out" | Port 587/465 might be blocked by your hosting provider. Try a different port or provider. |
| Gmail "Less secure apps" error | Use App Password instead. See Gmail section above. |
| Emails delayed | If using QUEUE_CONNECTION=database, make sure the queue worker is running. |