This is mail.html. Here you can add the checkboxes specifying the email address as values to those checkboxes.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Send mail</title>
</head>
<body>
<form action="mail.php" method="post">
<INPUT TYPE="checkbox" NAME="chk1" value="example1@example.com">Name 1
<INPUT TYPE="checkbox" NAME="chk2" value="example2@example.com">Name 2
<INPUT TYPE="checkbox" NAME="chk3" value="example3@example.com">Name 3
<INPUT TYPE="checkbox" NAME="chk4" value="example4@example.com">Name 4
<INPUT TYPE="checkbox" NAME="chk5" value="example5@example.com">Name 5
<INPUT TYPE="checkbox" NAME="chk6" value="example6@example.com">Name 6
<INPUT TYPE="checkbox" NAME="chk7" value="example7@example.com">Name 7
<input type="submit" value="Submit" name="submit">
</form>
</body>
</html>
This is mail.php. Here you loop through all the posted variables, check if its value is submit, if it is submit, then skip it, else, send a mail !
<?php //mail.php
foreach ($_POST as $key => $value){
if($value !="Submit"){
$to = $value;
$email="noreply@yoursite.com";
$subject="Test mail !!!!";
$message = "Hey ! I dont have any message !";
mail($to,$subject,$message,"From:".$email);
}
}
?>
Cheers,
Naveen
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356