<?php
require_once 'mail.php';

echo "Testing Email Sending with PHPMailer...\n";
echo "1. Trying to send to test@example.com (or a real email if updated)...\n";

// Use a placeholder or a safe test email. 
// Ideally the user would provide one, but for now we test the function call.
$res = send_gadget_email('info@ghadget.com', 'Test Subject PHPMailer', '<h1>It Works!</h1><p>Sent via PHPMailer.</p>');

if ($res === true) {
    echo "SUCCESS: Email sent successfully.\n";
} else {
    echo "FAILURE: " . $res . "\n";
}

echo "Check mail_log.txt for details.\n";
