# Email Configuration Guide

## Current Issue
Your application is currently using the `log` mail driver, which means emails are being written to log files instead of actually being sent.

## Solution: Configure SMTP

To send real emails, you need to configure SMTP in your `.env` file.

### Step 1: Update .env File

Add or update these lines in your `.env` file:

```env
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-app-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=your-email@gmail.com
MAIL_FROM_NAME="${APP_NAME}"
```

### Step 2: Gmail Setup (if using Gmail)

1. Enable 2-Step Verification on your Google Account
2. Generate an App Password:
   - Go to Google Account → Security → 2-Step Verification → App passwords
   - Generate a password for "Mail"
   - Use this password in `MAIL_PASSWORD`

### Step 3: Other Email Providers

#### For Outlook/Hotmail:
```env
MAIL_HOST=smtp-mail.outlook.com
MAIL_PORT=587
MAIL_ENCRYPTION=tls
```

#### For Yahoo:
```env
MAIL_HOST=smtp.mail.yahoo.com
MAIL_PORT=587
MAIL_ENCRYPTION=tls
```

#### For Custom SMTP:
```env
MAIL_HOST=your-smtp-server.com
MAIL_PORT=587
MAIL_USERNAME=your-username
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
```

### Step 4: Test Email Configuration

After updating your `.env` file, clear the config cache:

```bash
php artisan config:clear
php artisan config:cache
```

### Step 5: Test Sending

Try resending a ticket confirmation email from the admin panel to verify emails are being sent.

## Alternative: Use Mail Services

For production, consider using:
- **Mailgun** (free tier available)
- **SendGrid** (free tier available)
- **Amazon SES** (very affordable)
- **Postmark** (great for transactional emails)

## Check Logs

If emails still don't work, check:
- `storage/logs/laravel.log` for email errors
- Your email provider's spam folder
- Email provider's security settings

