# Email Configuration Guide for StoreWeb

## Current Issue
Emails are not being delivered because the application is using PHP's basic `mail()` function, which doesn't work properly in most local development environments like XAMPP.

## Solution Options

### Option 1: Install PHPMailer (Recommended)

1. Download PHPMailer from https://github.com/PHPMailer/PHPMailer
2. Extract to `includes/PHPMailer/` directory
3. Your directory structure should look like:
   ```
   includes/
   ├── PHPMailer/
   │   ├── src/
   │   │   ├── PHPMailer.php
   │   │   ├── SMTP.php
   │   │   └── Exception.php
   │   └── ...
   ```

### Option 2: Configure XAMPP's sendmail

1. Edit `C:\xampp\php\php.ini`:
   ```
   [mail function]
   SMTP=smtp.gmail.com
   smtp_port=587
   sendmail_from=ahoststore1@gmail.com
   sendmail_path="C:\xampp\sendmail\sendmail.exe" -t
   ```

2. Edit `C:\xampp\sendmail\sendmail.ini`:
   ```
   [sendmail]
   smtp_server=smtp.gmail.com
   smtp_port=587
   error_logfile=error.log
   debug_logfile=debug.log
   auth_username=ahoststore1@gmail.com
   auth_password=qwjr gmtr imdx uqlq
   force_sender=ahoststore1@gmail.com
   ```

### Option 3: Use Gmail App Passwords

1. Enable 2-Factor Authentication on your Gmail account
2. Generate an App Password:
   - Go to Google Account settings
   - Security → 2-Step Verification → App passwords
   - Generate a new app password for "Mail"
   - Use this 16-character password instead of your regular password

## Testing Email Functionality

1. Visit `http://localhost/storeweb/test_email.php`
2. Check your inbox and spam folder
3. Check PHP error logs for any issues

## Troubleshooting

If emails still don't arrive:
1. Check your spam folder
2. Verify Gmail account security settings
3. Ensure proper SMTP configuration
4. Check server error logs