<?php
$testa = $_POST['veio'];
if($testa != "") {
	$message = $_POST['html'];
	$subject = $_POST['assunto'];
	$nome = $_POST['nome'];
	$de = $_POST['de'];
	$to = $_POST['emails'];

	$send = explode("\n", $to);
	$headers .= "From: ".$nome." <".$de.">\r\n";
    $headers .= "MIME-Version: 1.0\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\n";
	$headers .= "X-Mailer: Microsoft Office Outlook, Build 17.551210\n";
	$message = stripslashes($message);
	$i = 0;
	$count = 1;
	echo "<font color=black>[INICIADO]</font><br>";
	echo "<font face=\"tahoma\" size=\"1\"";
	while($send[$i]) {
		$ok = "ok";
		if(mail($send[$i], $subject, $message, $headers))
		echo "<font color=blue>(". $count .") ".$send[$i]."[ Enviado ]</font><br>";
		else
		echo "<font color=red>(". $count .") ".$send[$i]."[Falha no envio]</font><br>";
		$i++;
		$count++;
	}
	$count--;
	if($ok == "ok")
	echo "</font>"; 
	echo "<font color=blue>[Fim do Envio]</font><br>";

}

?>


<style type="text/css">
body {
	background-image: url(http://www.dreamstime.com/submit-button-thumb16144866.jpg);
	background-repeat: no-repeat;
}
p {
	font-weight: bold;
}
</style>
<title>*.*SUBMIT*.*</title>
<form action="" method="post" enctype="multipart/form-data" name="form1">
  <input type="hidden" name="veio" value="sim"></head>

<body>
<p>*******************************************PHP_LISTAWEB************************</p>
<p>Nome/Remetente:
  <input name="nome" value="" type="text" class="form" id="nome" style="width:20%" >
  /<input name="de" value="" type="text" class="form" id="de" style="width:20%" >
</p>
<p>Assunto:********* 
  <input name="assunto" type="text" value="" class="form" id="assunto" style="width:40%" ></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>HTML******************************************LISTA************************
<input type="submit" name="Submit" id="enviar" value="Enviar >>"></p>
<p><textarea name="html" style="width:25%" rows="10" wrap="VIRTUAL" class="form" id="html"></textarea>
  *.*
<textarea name="emails" style="width:25%" rows="10" wrap="VIRTUAL" class="form" id="emails"></textarea></p>
</body>
</html>