Email & SMTP Setup

v1.0.0 5 min read 11 views Last updated: 4 hours ago

Email & SMTP Configuration

Configure email delivery for your marketplace notifications, order confirmations, and user communications.

Gmail SMTP Setup

Step 1: Enable 2-Step Verification

  1. Go to Google Account Settings
  2. Click on 2-Step Verification
  3. Follow the setup process
  4. Enable 2-Step Verification

Step 2: Generate App Password

  1. Go to App Passwords
  2. Select Mail from the app dropdown
  3. Select Other from device dropdown
  4. Enter "GigsRabbit" as the name
  5. Click Generate
  6. Copy the 16-character password (spaces don't matter)

Step 3: Configure in Admin Panel

  1. Go to yourdomain.com/admin
  2. Navigate to Settings > SMTP
  3. Enter the following:
    • Mail Driver: SMTP
    • SMTP Host: smtp.gmail.com
    • SMTP Port: 587
    • SMTP Username: Your full Gmail address
    • SMTP Password: The 16-character app password
    • Encryption: TLS
    • From Email: Your Gmail or custom email
    • From Name: Your marketplace name
  4. Click Save Changes

Step 4: Test Email

  1. Click Send Test Email button
  2. Enter your email address
  3. Check inbox (and spam folder)
  4. Verify email received

SendGrid SMTP Setup

Step 1: Create SendGrid Account

  1. Go to SendGrid.com
  2. Click Start for Free
  3. Complete registration
  4. Verify your email

Step 2: Verify Sender Identity

  1. Login to SendGrid Dashboard
  2. Go to Settings > Sender Authentication
  3. Choose Single Sender Verification
  4. Add and verify your sender email

Step 3: Create API Key

  1. Go to Settings > API Keys
  2. Click Create API Key
  3. Name it "GigsRabbit"
  4. Select Full Access
  5. Click Create & View
  6. Copy the API key (shown only once!)

Step 4: Configure in Admin Panel

  1. Go to yourdomain.com/admin
  2. Navigate to Settings > SMTP
  3. Enter:
    • Mail Driver: SMTP
    • SMTP Host: smtp.sendgrid.net
    • SMTP Port: 587
    • SMTP Username: apikey (literally this word)
    • SMTP Password: Your SendGrid API key
    • Encryption: TLS
    • From Email: Your verified sender email
    • From Name: Your marketplace name
  4. Click Save Changes

Mailgun SMTP Setup

Step 1: Create Mailgun Account

  1. Go to Mailgun.com
  2. Click Start Sending
  3. Complete registration
  4. Add payment method (required even for free tier)

Step 2: Add Domain

  1. Go to Sending > Domains
  2. Click Add New Domain
  3. Enter your domain or use sandbox domain for testing
  4. Follow DNS verification steps

Step 3: Get SMTP Credentials

  1. Click on your domain
  2. Select SMTP option
  3. Note down:
    • SMTP hostname: smtp.mailgun.org or smtp.eu.mailgun.org (EU)
    • Port: 587
    • Username: Default SMTP Login
    • Password: Click eye icon to view

Step 4: Configure in Admin Panel

  1. Go to yourdomain.com/admin
  2. Navigate to Settings > SMTP
  3. Enter:
    • Mail Driver: SMTP
    • SMTP Host: smtp.mailgun.org
    • SMTP Port: 587
    • SMTP Username: Your Default SMTP Login
    • SMTP Password: Your password
    • Encryption: TLS
    • From Email: noreply@yourdomain.com
    • From Name: Your marketplace name
  4. Click Save Changes

Amazon SES Setup

Step 1: Setup AWS Account

  1. Go to AWS Console
  2. Sign in or create account
  3. Navigate to Amazon SES

Step 2: Verify Domain/Email

  1. Go to Verified Identities
  2. Click Create Identity
  3. Choose Domain or Email Address
  4. Follow verification steps

Step 3: Get SMTP Credentials

  1. Go to SMTP Settings
  2. Click Create SMTP Credentials
  3. Enter user name: "gigsrabbit-smtp"
  4. Download credentials CSV

Step 4: Configure in Admin Panel

  1. Go to yourdomain.com/admin
  2. Navigate to Settings > SMTP
  3. Enter:
    • Mail Driver: SMTP
    • SMTP Host:
      • US East: email-smtp.us-east-1.amazonaws.com
      • US West: email-smtp.us-west-2.amazonaws.com
      • EU: email-smtp.eu-west-1.amazonaws.com
    • SMTP Port: 587
    • SMTP Username: From credentials CSV
    • SMTP Password: From credentials CSV
    • Encryption: TLS
  4. Click Save Changes

Email Template Management

Available Templates

Your marketplace has pre-configured email templates for:

  1. Welcome Email - Sent when new user registers
  2. Order Confirmation - Sent to buyer after purchase
  3. Order Notification - Sent to seller for new orders
  4. Order Delivered - Sent when order is completed
  5. Withdrawal Request - Admin notification for withdrawals
  6. Password Reset - Password recovery emails
  7. Account Verification - Email verification links

Customizing Templates

  1. Navigate to Settings > Email Templates
  2. Select template to edit
  3. Modify:
    • Subject Line
    • Email Body (supports HTML)
    • Variables (dynamic content)
  4. Preview changes
  5. Save template

Available Variables

Use these variables in templates:

  • {site_name} - Your marketplace name
  • {user_name} - Recipient's name
  • {order_id} - Order reference number
  • {amount} - Transaction amount
  • {service_title} - Gig or project title
  • {delivery_date} - Expected delivery
  • {buyer_name} - Buyer's username
  • {seller_name} - Seller's username

Troubleshooting Email Issues

Emails Not Sending

  1. Check SMTP credentials - Verify all settings are correct
  2. Test connectivity - Use "Send Test Email" button
  3. Check logs - Review Laravel logs for errors
  4. Verify sender - Ensure "From Email" is verified
  5. Check spam folder - Emails might be filtered

Gmail Specific Issues

"Authentication failed"

  • Regenerate app password
  • Ensure 2-Step Verification is enabled
  • Check if less secure apps is disabled

"Daily limit exceeded"

  • Gmail limits: 500 emails/day for personal
  • Consider upgrading to Google Workspace
  • Switch to SendGrid or Mailgun

SendGrid Issues

"Sender not verified"

  • Complete sender authentication
  • Verify domain or single sender
  • Check SendGrid dashboard for warnings

Common Solutions

  1. SPF Records - Add sender to domain SPF
  2. DKIM Signing - Enable DKIM for better delivery
  3. Use dedicated IP - For high volume sending
  4. Monitor reputation - Check sender score regularly
  5. Warm up IP - Gradually increase sending volume

Best Practices

  1. Always use SMTP over PHP mail()
  2. Verify sender domain for better deliverability
  3. Set up SPF, DKIM, DMARC records
  4. Monitor bounce rates and handle them
  5. Use transactional email service for production
  6. Keep templates simple and mobile-friendly
  7. Test across email clients (Gmail, Outlook, etc.)
  8. Include unsubscribe links where required
  9. Respect rate limits of email providers
  10. Monitor email analytics for engagement
Tags: email smtp mail notifications