MAILPILOT — LARAVEL 12 EMAIL MARKETING APP
============================================

Requirements
------------
- cPanel hosting with PHP 8.3 (or compatible PHP 8.2+), MySQL/MariaDB, and the PHP extensions listed by Laravel.
- PHP functions checkdnsrr and mail transport sockets enabled by the host.

Upload and install (cPanel only)
---------------------------------
1. Upload this archive to cPanel File Manager. Extract it outside public_html if possible, for example:
   /home/USERNAME/mailpilot
2. In cPanel > Domains, set the domain document root to:
   /home/USERNAME/mailpilot/public
   Do not point the domain to the project root.
3. Copy .env.example to .env and edit it in File Manager. Set APP_URL to the real https URL, APP_KEY to the included generated key (or generate one only if your host provides Terminal), and set:
   DB_CONNECTION=mysql
   DB_HOST=127.0.0.1
   DB_PORT=3306
   DB_DATABASE=your_cpanel_database
   DB_USERNAME=your_cpanel_database_user
   DB_PASSWORD=your_database_password
   SESSION_DRIVER=database
   CACHE_STORE=file
4. In cPanel > MySQL Databases, create the database and user and grant ALL PRIVILEGES.
5. Open phpMyAdmin, select the new database, choose Import, and import schema.sql. This creates all tables and the admin account.
6. Edit .env mail values only as a fallback; SMTP settings are normally entered inside the admin panel. Save the file, then visit https://your-domain.example/login.
7. Log in with:
   Email: admin@example.com
   Password: password
   Change this password immediately by editing the users table in phpMyAdmin or adding a password-management package before production use.

Cron (required)
--------------
In cPanel > Cron Jobs, add this job to run every minute. Replace paths with your cPanel username and PHP binary path if needed:
* * * * * /usr/local/bin/php /home/USERNAME/mailpilot/artisan schedule:run >> /home/USERNAME/mailpilot/storage/logs/cron.log 2>&1
Common PHP paths are /usr/local/bin/php or /opt/cpanel/ea-php83/root/usr/bin/php.
The scheduler calls campaign:send, respects the pause toggle, sends pending subscribers, sleeps for the configured interval, and records sent/failed rows.

Important operational notes
---------------------------
- The app validates email syntax and performs an MX lookup. Some shared hosts disable DNS functions; in that case valid addresses may be skipped until the host enables checkdnsrr.
- Keep the From address aligned with the SMTP account and configure SPF/DKIM/DMARC in DNS for deliverability.
- Never commit .env or disclose SMTP passwords. Back up the database before bulk deletion.
- Vendor dependencies are included in this archive; no Composer or terminal access is required on cPanel.
