My question is as follows: the code is working as expected the problem when I put a large email list (100) the page gets all in white "loading" and only returns me the result after the script ends to be executed, I need a solution that allows me to show the result according to the loop and passing on the screen.
I thought of using jQuery to be able to automate sending 1 by 1 and go showing the result I think that way the server will not overload.
I do not know what to do now, but I need some help from at least knowing what to search for and what function should I use to load the data dynamically.
The code is this here below:
$email = explode("\n", $to);
$headers .= "From: ".$nome." <".$de.">\r\n";
$message = stripslashes($message);
$i = 0;
$count = 1;
while($email[$i]) {
$ok = "Ok!";
if(mail($email[$i], $subject, $message, $headers))
echo "Aguarde: $count <b>".$email[$i]."</b> <font color=red>Email Enviado </font> <br><hr>";
else
echo "Aguarde!: $count <b>".$email[$i]."</b> <font color=red>Email não enviado. </font><br><hr>";
$i++;
$count++;
}
$count--;
if($ok == "ok")
echo "";