That makes sense.
So if I have a simple form, literally :
<form action="sendemails.php" method="post" enctype="multipart/form-data" name="send_email">
<p>Send emails </p>
<p><input type="submit" name="Submit" value="Submit">
</p>
</form>
And a sendmails.php page that does all the processing, by being passed the records from the results page?
I've used send mail before in a contact page, but just sending one email with code like :
$emailTo = '"mycompany" <info@mycompany.com>';
$emailSubject = "Enquiry from website";
$emailSubject = preg_replace('/[\x00-\x1F]/', '', $emailSubject);
$emailFrom = "$FTGemail";
$emailFrom = preg_replace('/[\x00-\x1F]/', '', $emailFrom);
$emailBody = "First name : $FTGfirstname\n"
. "Last name : $FTGlastname\n"
. "\n"
. "Telephone number: $FTGtel\n"
. "Email address : $FTGemail\n"
. "\n"
. "Enquiry : $FTGmessage\n"
. "\n"
. "Preferred method of contact : $FTGRadioGroup1\n"
. "\n"
. "\n"
. "";
$emailHeader = "From: $emailFrom\n"
. "Reply-To: $emailFrom\n"
. "MIME-Version: 1.0\n"
. "Content-type: text/plain; charset=\"ISO-8859-1\"\n"
. "Content-transfer-encoding: 8bit\n";
mail($emailTo, $emailSubject, $emailBody, $emailHeader);
So do I just need to add some code to loop (a while loop?) through the records? That's the part I'm unsure of the syntax?