I have a very simple script (below) that works fine when sending email to a single email address, however when I add another (as I have in the script below) by seperating with a comma, the script just sends the email to one of the addresses twice and not to the other one at all. Why might this be please?
<?php
//start building the mail string
$msg = "First name: $_POST[firstname]\n";
$msg .= "Second name: $_POST[secondname]\n";
$msg .= "Email Address: $_POST[email1]\n";
$thankyoupage = "/signup-thankyou";
//set up the mail
$recipient = "recipient1@test.com,recipient2@test.com"; //the inbox where the sent mail goes
$subject = "Newsletter signup";
$mailheaders = "From: Website <recipient1@test.com,recipient2@test.com> \n";
$mailheaders .= "Reply-To: $_POST[email]";
//send the mail
mail($recipient, $subject, $msg, $mailheaders);
header("Location: $thankyoupage");
?>
Thankyou