Email and SMTP Configuration

Email and SMTP Configuration

Email Overview

Flatboard 5 uses email for:

  • User Registration - Email verification
  • Password Reset - Password recovery links
  • Notifications - Discussion and post notifications
  • Administrative - System notifications
  • User Communication - Private messages (if enabled)

SMTP Configuration

Why SMTP?

SMTP (Simple Mail Transfer Protocol) provides:

  • Reliable Delivery - Better delivery rates than PHP mail()
  • Authentication - Secure email sending
  • Tracking - Delivery and bounce tracking
  • Professional - Proper email headers and formatting

Basic SMTP Setup

Access: Admin Panel > Settings > Email

  1. Enable SMTP - Turn on SMTP sending
  2. SMTP Host - Your mail server address
  3. SMTP Port - Usually 587 (TLS) or 465 (SSL)
  4. Encryption - Choose TLS or SSL
  5. Username - SMTP authentication username
  6. Password - SMTP authentication password
  7. From Email - Sender email address
  8. From Name - Sender display name

Common SMTP Providers

Gmail

Host: smtp.gmail.com
Port: 587
Encryption: tls
Username: your-email@gmail.com
Password: (App Password - see below)

Outlook/Office 365

Host: smtp.office365.com
Port: 587
Encryption: tls
Username: your-email@outlook.com
Password: (Your account password)

SendGrid

Host: smtp.sendgrid.net
Port: 587
Encryption: tls
Username: apikey
Password: (Your SendGrid API key)

Mailgun

Host: smtp.mailgun.org
Port: 587
Encryption: tls
Username: (Your Mailgun SMTP username)
Password: (Your Mailgun SMTP password)

Amazon SES

Host: email-smtp.region.amazonaws.com
Port: 587
Encryption: tls
Username: (Your SES SMTP username)
Password: (Your SES SMTP password)

Testing Email Configuration

Test Email Function

Use the built-in test email:

  1. Go to Admin Panel > Settings > Email
  2. Enter test email address
  3. Click "Send Test Email"
  4. Check inbox for test email

Manual Testing

Test via CLI:

php app/Cli/console.php email:test your-email@example.com

Troubleshooting Test Emails

If test email fails:

  1. Check SMTP Settings - Verify all settings correct
  2. Check Credentials - Ensure username/password correct
  3. Check Firewall - Ensure SMTP port not blocked
  4. Check Logs - Review error logs for details
  5. Test Connection - Use telnet to test SMTP connection
# Test SMTP connection
telnet smtp.gmail.com 587

Email Templates

Customizing Templates

Email templates can be customized:

  • Registration Email - Welcome message
  • Password Reset - Reset instructions
  • Notification Email - Discussion/post notifications
  • Admin Notifications - System notifications

Template Variables

Use variables in templates:

  • {site_name} - Forum name
  • {site_url} - Forum URL
  • {user_name} - User's name
  • {reset_link} - Password reset link
  • {verification_link} - Email verification link

Email Verification

Enabling Email Verification

  1. Go to Admin Panel > Settings > Users
  2. Enable "Email Verification"
  3. Configure verification email template
  4. Save settings

Verification Process

  1. User registers account
  2. Verification email sent
  3. User clicks verification link
  4. Account activated
  5. User can log in

Resending Verification

Users can request new verification email:

  • Login page > "Resend Verification Email"
  • Enter email address
  • New email sent

Password Reset

Password Reset Flow

  1. User clicks "Forgot Password"
  2. Enters email address
  3. Reset email sent with link
  4. User clicks link
  5. User sets new password
  6. User can log in

Reset Email Configuration

Configure reset email:

  • Reset Link Expiry - How long link is valid (default: 1 hour)
  • Reset Email Template - Customize email content
  • Rate Limiting - Limit reset requests per hour

Email Notifications

User Notifications

Users receive emails for:

  • New Replies - Replies to subscribed discussions
  • Mentions - When mentioned in posts
  • Private Messages - New private messages (if enabled)
  • Quotes - When quoted in posts

Notification Preferences

Users can configure:

  • Email Frequency - Immediate, daily digest, weekly
  • Notification Types - Which notifications to receive
  • Unsubscribe - Unsubscribe from specific notifications

Access: User Profile > Settings > Notifications

Email Best Practices

Deliverability

Improve email deliverability:

  • SPF Records - Configure SPF for your domain
  • DKIM - Set up DKIM signing
  • DMARC - Configure DMARC policy
  • Reputation - Maintain good sender reputation

Content

  • Clear Subject Lines - Descriptive subjects
  • Plain Text Alternative - Include plain text version
  • Unsubscribe Links - Include unsubscribe option
  • Professional Formatting - Clean, professional design

Security

  • Use TLS/SSL - Encrypt SMTP connections
  • Strong Passwords - Use strong SMTP passwords
  • Limit Access - Restrict SMTP access
  • Monitor Logs - Review email logs regularly

Troubleshooting

Emails Not Sending

Check:

  1. SMTP settings are correct
  2. Credentials are valid
  3. Firewall allows SMTP port
  4. SMTP server is accessible
  5. Check error logs

Common Issues:

  • Authentication Failed - Wrong username/password
  • Connection Timeout - Firewall blocking or wrong host
  • SSL/TLS Error - Wrong encryption type
  • Port Blocked - ISP blocking SMTP port

Emails Going to Spam

Solutions:

  1. Configure SPF records
  2. Set up DKIM signing
  3. Use reputable SMTP provider
  4. Avoid spam trigger words
  5. Include unsubscribe links

Rate Limiting

Some providers limit sending:

  • Gmail - 500 emails/day (free), 2000/day (Workspace)
  • SendGrid - Based on plan
  • Mailgun - Based on plan
  • Amazon SES - Starts with sandbox mode

Advanced Configuration

Multiple SMTP Accounts

For high-volume sites, consider:

  • Multiple Providers - Use different providers
  • Load Balancing - Distribute across providers
  • Failover - Automatic failover if one fails

Email Queue

For better performance:

  • Queue Emails - Queue instead of sending immediately
  • Background Processing - Process queue in background
  • Retry Logic - Retry failed sends

Email Logging

Enable email logging:

  • Log All Emails - Log sent emails
  • Log Failures - Log failed sends
  • Delivery Tracking - Track delivery status

Resources

Last updated: February 23, 2026