Skip to main content

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โ€‹

  1. Log in as superadmin
  2. Go to Admin โ†’ Settings โ†’ Email
  3. Fill in your SMTP details
  4. Click Send Test Email to verify
  5. 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.

  1. Go to Google Account Security
  2. Enable 2-Step Verification (required)
  3. Go to App passwords โ†’ select "Mail" โ†’ generate
  4. 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
  1. Sign up at Mailgun
  2. Add your domain โ†’ verify DNS records
  3. Go to Sending โ†’ Domain Settings โ†’ SMTP credentials
  4. 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
  1. Go to AWS SES Console
  2. Verify your domain
  3. Go to SMTP Settings โ†’ Create SMTP Credentials
  4. 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โ€‹

  1. Go to Admin โ†’ Settings โ†’ Email
  2. Click Send Test Email
  3. 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โ€‹

EmailWhenRecipient
WelcomeNew tenant registersTenant admin
Team InvitationAdmin invites team memberInvitee email
Plan ChangedSubscription changesTenant admin
New Submission AlertNew feedback receivedTenant admin/staff
Email DigestDaily/weekly scheduleTenant admin
Scheduled ReportDaily/weekly/monthlyTenant admin
Usage Alert90%+ of plan limitTenant admin
Password ResetUser requests resetRequesting user
Email VerificationNew registrationNew user
OTP CodeFeedback form with OTPEnd user submitting feedback

๐Ÿ› Troubleshooting Emailโ€‹

IssueSolution
Emails not sendingCheck .env SMTP settings. Try MAIL_MAILER=log to test without SMTP. Check storage/logs/laravel.log.
Emails going to spamAdd 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" errorUse App Password instead. See Gmail section above.
Emails delayedIf using QUEUE_CONNECTION=database, make sure the queue worker is running.

โญ๏ธ Next Stepsโ€‹