$email_from, 'from_name' => $email_from_name, 'recipient' => $email_to, 'recipient_name' => 'Chap', 'subject' => $subject, 'body' => $body ] ]; $mail = addToMailQueue($data); if ($mail === true) { $_SESSION['alert_message'] = "Test email queued successfully! Check Admin > Mail queue"; } else { $_SESSION['alert_type'] = "error"; $_SESSION['alert_message'] = "Failed to add test mail to queue"; } header("Location: " . $_SERVER["HTTP_REFERER"]); } // Test IMAP // Autoload Composer dependencies // require_once __DIR__ . '/../plugins/php-imap/vendor/autoload.php'; // Webklex PHP-IMAP //use Webklex\PHPIMAP\ClientManager; if (isset($_POST['test_email_imap'])) { /* validateCSRFToken($_POST['csrf_token']); try { // Initialize the client manager and create the client $clientManager = new ClientManager(); $client = $clientManager->make([ 'host' => $config_imap_host, 'port' => $config_imap_port, 'encryption' => $config_imap_encryption, 'validate_cert' => true, 'username' => $config_imap_username, 'password' => $config_imap_password, 'protocol' => 'imap' ]); // Connect to the IMAP server $client->connect(); $_SESSION['alert_message'] = "Connected successfully"; } catch (Exception $e) { $_SESSION['alert_type'] = "error"; $_SESSION['alert_message'] = "Test IMAP connection failed: " . $e->getMessage(); } */ $_SESSION['alert_message'] = "Test is Work In Progress"; header("Location: " . $_SERVER["HTTP_REFERER"]); }