I'm using sendmail, the problem and the following. I use checkbox to mark the recipients. How do I checkboxes when I checkboxes fill a variable with each recipient, comma, and next recipient?
input type="checkbox" name="todos" class="todos" onclick="marcardesmarcar()" /> Todos<br/>
<input type="checkbox" class="marcar" name="email1" value="[email protected]" /> email1 ([email protected])<br/>
<input type="checkbox" class="marcar" name="email2" value="[email protected]" /> email2 ([email protected])<br/>
<input type="checkbox" class="marcar" name="email3" value="[email protected]" /> email3 ([email protected])<br>
Variable you will receive in php:
$email = $_POST["email"];
After doing the validation and filled the body. Send:
mail($email,$assunto,$mensagem, $headers, "-r".$email_from);