Email Configuration
Complete guide to configuring email delivery during installation.
Email delivery is essential for Reward Loyalty to function. The platform uses passwordless OTP (One-Time Password) authentication—without working email, no one can log in.
This guide walks you through configuring email during the installation wizard.
Why Email Is Required
Reward Loyalty uses a passwordless login system for security and convenience. When users sign in, they receive a 6-digit verification code via email instead of using a traditional password.
Without working email:
- Users cannot log in
- Password resets won't work
- Notifications won't be delivered
- The application cannot function
This is why email configuration is a critical step in the installation process.
Email Configuration Overview
During installation (Step 2: Configuration), you'll configure email delivery in the Email Delivery section. The wizard provides:
- Visual driver selection — Choose from production services or development options
- Context-aware forms — Only relevant fields appear based on your selection
- Built-in guidance — Helpful descriptions and provider-specific tips
- Test email feature — Verify your configuration works before completing installation
Choosing a Mail Driver
The installation wizard offers several mail drivers, each suited for different use cases.
Production Drivers
SMTP Server — Connect to any email server using the standard SMTP protocol.
- Best for: Most users, hosting providers, existing email infrastructure
- Pros: Works with any email provider, widely supported
- Cons: Requires SMTP credentials, may have sending limits
Mailgun — Professional email delivery service with powerful APIs.
- Best for: Growing businesses, high volume sending
- Pros: Reliable delivery, detailed analytics, generous free tier (100 emails/day for 3 months)
- Cons: Requires account setup, domain verification
Amazon SES — Cost-effective email at scale through AWS.
- Best for: AWS users, large-scale operations
- Pros: Very affordable, highly scalable, integrates with AWS ecosystem
- Cons: Sandbox mode requires verified recipients initially, AWS account required
Postmark — Built specifically for transactional email.
- Best for: Speed-critical applications, high deliverability requirements
- Pros: Excellent deliverability, fast delivery, great support
- Cons: Requires server approval for production, paid service
Resend — Modern email API built for developers.
- Best for: Developer-focused teams, modern tech stacks
- Pros: Clean API, generous free tier, modern interface
- Cons: Newer service, requires API key
Sendmail — Use your server's built-in mail system.
- Best for: Simple setups, Linux servers with sendmail installed
- Pros: No external dependencies, simple configuration
- Cons: Limited features, may have deliverability issues
Development & Testing Options
Mailpit (Testing) — Catch all emails locally without sending them externally.
- Best for: Local development only
- How it works: Emails are sent to localhost:1025 and viewable at localhost:8025
- Pros: Safe for testing, no external sending, view all emails in browser
- Cons: Development only, requires Mailpit running locally
Log File (Development) — Write emails to the application log file.
- Best for: Quick testing, debugging
- How it works: Full email content written to
storage/logs/laravel.log - Pros: No setup required, useful for debugging
- Cons: Development only, no visual preview
⚠️ Warning: Development drivers are for local development only. Never use Mailpit or Log drivers in production—they won't send real emails.
Configuration Steps
1. Enter Sender Information
All mail drivers require sender information:
From Email — The email address that appears as the sender.
- Use a professional address from your domain:
noreply@yourdomain.com - Avoid free email services (Gmail, Yahoo) to prevent spam filtering
- Must be a valid, properly formatted email address
From Name — The display name shown alongside the email address.
- Use your business or application name: "Acme Rewards"
- Keep it recognizable to prevent spam filtering
- Maximum 64 characters
Example preview:
From: Acme Rewards <noreply@acmerewards.com>
2. Select Your Mail Driver
Click on one of the driver cards to select it. The form will update to show only the relevant configuration fields for your chosen driver.
3. Configure Driver-Specific Settings
SMTP Server Configuration
Host — Your SMTP server address.
- Example:
smtp.gmail.com,smtp.office365.com,mail.yourdomain.com - Default:
smtp.gmail.com
Port — The SMTP server port.
- 587 — TLS encryption (recommended for most servers)
- 465 — SSL encryption (alternative for some servers)
- 25 — Unencrypted (often blocked by hosting providers)
- Default:
587
Username — Your SMTP account username.
- Usually your full email address
- Example:
your-email@gmail.com
Password — Your SMTP account password.
- For Gmail: Use an App Password (see Using Gmail below)
- For other providers: Use your email password or app-specific password
Encryption — Security protocol for the connection.
- TLS — Recommended for port 587
- SSL — Use with port 465
- None — Unencrypted (not recommended)
Using Gmail
Gmail requires special configuration due to 2-Step Verification:
- Enable 2-Step Verification in your Google Account settings
- Create an App Password:
- Go to Google Account Security
- Select "2-Step Verification"
- Scroll to "App passwords"
- Generate a new app password for "Mail"
- Use the App Password (16 characters) in the Password field
⚠️ Important: Regular Gmail passwords will NOT work. You must use an App Password.
Gmail SMTP Settings:
- Host:
smtp.gmail.com - Port:
587 - Username: Your full Gmail address
- Password: Your 16-character App Password
- Encryption: TLS
Mailgun Configuration
Domain — Your Mailgun sending domain.
- Example:
mg.yourdomain.com - Must be verified in your Mailgun account
- Found in Mailgun dashboard under "Sending" → "Domains"
API Key — Your Mailgun API key.
- Found in Mailgun dashboard under "Settings" → "API Keys"
- Use your "Private API key" (starts with
key-) - Keep this secret—never share it publicly
Region — Your Mailgun server region.
- United States — Use
api.mailgun.net(default) - European Union — Use
api.eu.mailgun.net - Choose the region where you created your Mailgun account
Amazon SES Configuration
Access Key ID — Your AWS access key.
- Found in AWS IAM console under "Security credentials"
- Example:
AKIAIOSFODNN7EXAMPLE
Secret Access Key — Your AWS secret key.
- Shown only once when creating the access key
- Keep this secret—never share it publicly
Region — Your AWS SES region.
- Example:
us-east-1,eu-west-1,ap-southeast-1 - Choose the region where you verified your sender
- Default:
us-east-1
ℹ️ SES Sandbox Mode: New AWS accounts start in sandbox mode, which requires verifying recipient email addresses. Request production access in the AWS SES console to send to any address.
Postmark Configuration
Server API Token — Your Postmark server token.
- Found in Postmark account under "Servers" → "API Tokens"
- Starts with a long alphanumeric string
- Each server has its own token
Resend Configuration
API Key — Your Resend API key.
- Found in Resend dashboard under "API Keys"
- Starts with
re_ - Create a new key if needed
Sendmail Configuration
No additional configuration required. Sendmail uses your server's built-in mail system.
ℹ️ Requirements: Sendmail must be installed and configured on your server. Most Linux servers have this by default.
Mailpit Configuration (Development)
No additional configuration required.
ℹ️ Requirements: Mailpit must be running locally. Emails are sent to
localhost:1025and viewable athttp://localhost:8025.
Log Configuration (Development)
No additional configuration required.
ℹ️ Log Location: Emails are written to
storage/logs/laravel.log. View the file to see full email content.
4. Test Your Configuration (Recommended)
Before completing installation, verify your email configuration works:
- Enter your email address in the Test Email field
- Click Send Test Email
- Check your inbox (and spam folder) for the test message
- If successful, you'll see: "Test email sent! Check your inbox."
💡 Tip: Always test before proceeding. Finding email issues now is much easier than troubleshooting after installation.
Test email is not available for:
- Log driver — Check
storage/logs/laravel.loginstead - Mailpit driver — View emails at
http://localhost:8025
Troubleshooting Test Emails
If the test email fails, you'll see a specific error message with troubleshooting guidance.
"Cannot connect to the mail server"
Cause: Server address or port is incorrect.
Solution:
- Verify the SMTP host is correct
- Try common ports: 587 (TLS), 465 (SSL), 25 (unencrypted)
- Check if your hosting provider blocks certain ports
- Verify your server has outbound email access
"Invalid username or password"
Cause: Credentials are incorrect.
Solution:
- For Gmail: Use an App Password, not your regular password
- For other providers: Verify username and password are correct
- Check for typos or extra spaces
- Ensure the account is active
"The mail server refused the connection"
Cause: Server is blocking the connection or port is wrong.
Solution:
- Try a different port (587 vs 465)
- Check firewall settings
- Verify SMTP access is enabled for your account
- Contact your hosting provider
"Connection timed out"
Cause: Network issue or server is unreachable.
Solution:
- Check your internet connection
- Verify the SMTP server is online
- Try again in a few minutes
- Check if your hosting provider blocks outbound connections
"Security error"
Cause: SSL/TLS encryption mismatch.
Solution:
- Try switching between TLS and SSL
- Port 587 usually requires TLS
- Port 465 usually requires SSL
- Try "None" encryption as a last resort (not recommended)
"The server rejected the email"
Cause: Sender address not authorized.
Solution:
- Use an email address from a verified domain
- For Mailgun/SES: Verify the sender domain in your account
- For SMTP: Ensure the from address matches your authenticated account
- Check sender authentication requirements
"Mail relay not permitted"
Cause: Server doesn't allow sending from this address.
Solution:
- Verify the from address is authorized
- Check SMTP authentication settings
- Ensure username matches the from address
- Contact your email provider
Email Not Received
If the test shows success but you don't receive the email:
- Check spam/junk folder — Test emails often get filtered
- Wait a few minutes — Delivery can be delayed
- Verify the email address — Check for typos
- Try a different email — Test with another address
- Check provider settings — Some providers block automated emails
After Installation
Email configuration is saved to your .env file during installation. After installation completes, you can:
- Update sender information — In admin panel under System Settings → Email Settings
- Change SMTP settings — Edit the
.envfile directly (requires server access) - Test email delivery — Trigger a password reset or OTP login to verify
For post-installation email configuration, see Configuring Email Settings.
Best Practices
For Production:
- Use a dedicated transactional email service (Mailgun, SES, Postmark, or Resend)
- Avoid personal email SMTP (Gmail, Yahoo, etc.)
- Use a professional from address:
noreply@yourdomain.com - Always send a test email before completing installation
- Configure SPF, DKIM, and DMARC records for better deliverability
For Development:
- Use Mailpit for local development—it's safe and convenient
- Log driver is useful for quick debugging
- Never use development drivers in production
Security:
- Keep API keys and passwords secure
- Never commit credentials to version control
- Use environment-appropriate credentials (dev vs production)
- Consider using secrets management in production
Provider-Specific Notes
Gmail:
- Requires 2-Step Verification and App Password
- Free tier has daily sending limits
- Not recommended for production use
Mailgun:
- Free tier: 100 emails/day for 3 months
- Requires domain verification
- EU region available for GDPR compliance
Amazon SES:
- Very affordable: $0.10 per 1,000 emails
- Sandbox mode requires verified recipients
- Request production access for unrestricted sending
Postmark:
- Excellent deliverability and speed
- Requires server approval for production
- Paid service with free trial
Resend:
- Generous free tier
- Modern API and interface
- Good for developer-focused teams
Next Steps
- Complete Installation — Finish the installation wizard
- License & Updates — Activate your license
- Email Settings — Update sender information post-installation
- OTP & Login Issues — Troubleshoot login problems