View Full Version : Can I add more than one email receiver to a form?

04-30-2009, 07:58 PM
I am trying to have the form submited to more than just one email address. How can I add one more email to this script? Here is part of the script. Thank you in advance


$emailSubject = 'EmailMe!';
$webMaster = 'myfirstemailaddress';
///////// I want to add another email address so that 2 people get the same info/////////

$nameField = $_POST['name'];
$emailField = $_POST['email'];
$phonedayField = $_POST['phoneday'];
$phoneeveningField = $_POST['phoneevening'];
$timetocallField = $_POST['timetocall'];
$commentsField = $_POST['comments'];

$body = <<<EOD
Email: $emailField <p>
Name: $nameField <p>
Daytime Phone Number: $phonedayField <p>
Evening Phone Number: $phoneeveningField <p>
Best to call: $timetocallField <p>
Questions, Comments: $commentsField <p>

$headers = "From: $emailField\r\n";
$headers = "Content-type: text/html\r\n";
$success = mail($webMaster, $emailsubject, $body, $headers);

Len Whistler
04-30-2009, 08:00 PM
$email = 'EmailMe!';
$webMaster = 'myfirstemailaddress';

$success = mail($email, $emailsubject, $body, $headers);
$success = mail($webMaster, $emailsubject, $body, $headers);