Email Multiple Recipients

What do I need to add to this code in order to send it to 2 recipients? Using aaa@aaa.com / bbb@bbb.com as the addresses can someone please show me?

Thanks!

Sam

<?php
session_start();

	ini_set(sendmail_from, $email);
	
/* Subject and Email Variables */

	$subject = 'Insurance Quote Request';
	$to = 'aaa@aaa.com';
	
/* Gathering Data Variables */	

	$type_of_insurance = $_POST['type_of_insurance'];
	$name = $_POST['name'];
	$ssn = $_POST['ssn'];
	$phone = $_POST['phone'];
	$email = $_POST['email'];
	$street = $_POST['street'];
	$city = $_POST['city'];
	$state = $_POST['state'];
	$zip = $_POST['zip'];
	$number_of_units = $_POST['number_of_units'];
	$square_footage = $_POST['square_footage'];
	$year_built = $_POST['year_built'];
	$city_garaged = $_POST['city_garaged'];
	$pets = $_POST['pets'];
	$updates = $_POST['updates'];
	$current_insurance_company = $_POST['current_insurance_company'];
	$why_was_policy_cancelled = $_POST['why_was_policy_cancelled'];
	$paid_losses = $_POST['paid_losses'];
	$amount_requested = $_POST['amount_requested'];
	$amps = $_POST['amps'];
	$does_owner_live_on_property = $_POST['does_owner_live_on_property'];
	$new_or_existing_residence = $_POST['new_or_existing_residence'];
	$type_of_structure = $_POST['type_of_structure'];
	$heating_source = $_POST['heating_source'];
	$coverage_cancelled = $_POST['coverage_cancelled'];
	$license_number = $_POST['license_number'];
	$dob = $_POST['dob'];
	$first_license = $_POST['first_license'];
	$vin_number = $_POST['vin_number'];
	$vehicle_make = $_POST['vehicle_make'];
	$vehicle_model = $_POST['vehicle_model'];
	$vehicle_year = $_POST['vehicle_year'];
	$uninsured_motorist = $_POST['uninsured_motorist'];
	$property_damage = $_POST['property_damage'];
	$bodily_injury = $_POST['bodily_injury'];
	$medical_payments = $_POST['medical_payments'];
	$collision_deductible = $_POST['collision_deductible'];
	$limited_collision_deductible = $_POST['limited_collision_deductible'];
	$comprehensive_deductible = $_POST['comprehensive_deductible'];
	$substitute_transportation = $_POST['substitute_transportation'];
	$towing_and_labor = $_POST['towing_and_labor'];
	$underinsured_motorist = $_POST['underinsured_motorist'];
	$mileage = $_POST['mileage'];
	$alarm = $_POST['alarm'];
	$airbags = $_POST['airbags'];
	$guidepoint = $_POST['guidepoint'];
	$lojack = $_POST['lojack'];
	$onstar = $_POST['onstar'];
	$auto_remarks = $_POST['auto_remarks'];
	$home_remarks = $_POST['home_remarks'];
	$limited_collision_deductible = $_POST['limited_collision_deductible'];
	$body = "
<br><hr><br>
<h2>Personal Information</h2>
Name: $name <br>
SSN: $ssn <br>
Phone: $phone <br>
Email: $email <br>
Street: $street <br>
City: $city <br>
State: $state <br>
Zip: $zip <br>
<h1>Homeowners/Renters Quote Request</h1><br>
<h2>Residence</h2>
Type of insurance: $type_of_insurance <br>
Number of units: $number_of_units <br>
Square footage: $square_footage <br>
Year built: $year_built <br>
Pets: $pets <br>
Updates: $updates <br>
Current insurance company: $current_insurance_company <br>
If policy was cancelled, why?: $why_was_policy_cancelled <br>
Paid losses: $paid_losses <br>
Amount Requested: $amount_requested <br>
I verify that the electrical system is circuit breakers and at least 100 amps: $amps <br>
Does the owner live on the property?: $does_owner_live_on_property <br>
New or existing property?: $new_or_existing_residence <br>
Type of structure: $type_of_structure <br>
Heating source: $heating_source <br>
Has your coverage been cancelled in the last three years?: $coverage_cancelled <br>
Remarks: $home_remarks <br>
<h1>Auto Quote Request</h1><br><br>
<h2>Driver Information</h2>
License number: $license_number <br>
D.O.B.: $dob <br>
Year you received your first license: $first_license <br><br>
<h2>Vehicle Information</h2>
VIN number: $vin_number <br>
Make: $vehicle_make <br>
Model: $vehicle_model <br>
Year: $vehicle_year <br>
<h2>Coverages</h2>
Uninsured Motorist: $uninsured_motorist <br>
Property Damage: $property_damage <br>
Bodily Injury: $bodily_injury <br>
Medical Payments: $medical_payments <br>
Collision Deductible: $collision_deductible <br>
Limitied Collision Deductible: $limited_collision_deductible <br>
Comprehensive Deductible: $comprehensive_deductible <br>
Substitute Transportation: $substitute_transportation <br>
Towing and Labor: $towing_and_labor <br>
Underinsured Motorist: $underinsured_motorist <br>
Mileage: $mileage <br>
What city is the vehicle garaged in?: $city_garaged <br><br>
<h3>Options that your vehicle is equipped with</h3>
Alarm: $alarm <br>
Airbags: $airbags <br>
GuidePoint: $guidepoint <br>
LoJack: $lojack <br>
OnStar: $onstar <br>
Remarks: $auto_remarks <br>
";
$flag = true;
if ( isset($_POST['includeAutoQuote']) && ($_POST['includeAutoQuote'] == 'includeAutoQuote')  ) {
 if(!$name || !$phone || !$email || !$street || !$city || !$state || !$zip || !$license_number || !$dob || !$first_license || !$vin_number || !$vehicle_make || !$vehicle_model ||
!$vehicle_year || !$uninsured_motorist || !$property_damage || !$bodily_injury || !$city_garaged || !$mileage || !$underinsured_motorist) 
	{
		$flag = false;
	}
}

if ( isset($_POST['includeHomeQuote']) && ($_POST['includeHomeQuote'] == 'includeHomeQuote')  ) {
	if(!$name || !$phone || !$email || !$street || !$city || !$state || !$zip || !$type_of_insurance || !$number_of_units || !$square_footage || !$year_built || 
	!$current_insurance_company || !$amps || !$does_owner_live_on_property || !$new_or_existing_residence || !$type_of_structure || !$amount_requested || !$heating_source || 
	!$coverage_cancelled) {
		$flag = false;
	}
}

if($_POST && $flag == true && (isset($_POST['includeHomeQuote']) || isset($_POST['includeAutoQuote']))) {
	
	$headers = "From: $email\\r\
";
	$headers .= "Content-type: text/html\\r\
";

mail($to,$subject,$body,$headers);

$_SESSION['success'] = '1';
header('Location: sent.html');
exit;
}

?>

http://www.php.net/manual/en/function.mail.php

See the additional headers in example #4

For some reason the form is only sending to “samuel@searchtransparencysem.com” and not the gmail. Can someone help with this?

This is my current code:

<?php
session_start();

	ini_set(sendmail_from, $email);
	
/* Subject and Email Variables */

	$subject = 'Insurance Quote Request';
	$to  = 'samuel.grieve@gmail.com' . ', '; // note the comma
	$to .= 'samuel@searchtransparencysem.com';
	//samuel@searchtransparencysem.com
	
/* Gathering Data Variables */	

	$type_of_insurance = $_POST['type_of_insurance'];
	$name = $_POST['name'];
	$ssn = $_POST['ssn'];
	$phone = $_POST['phone'];
	$email = $_POST['email'];
	$street = $_POST['street'];
	$city = $_POST['city'];
	$state = $_POST['state'];
	$zip = $_POST['zip'];
	$number_of_units = $_POST['number_of_units'];
	$square_footage = $_POST['square_footage'];
	$year_built = $_POST['year_built'];
	$city_garaged = $_POST['city_garaged'];
	$pets = $_POST['pets'];
	$updates = $_POST['updates'];
	$current_insurance_company = $_POST['current_insurance_company'];
	$why_was_policy_cancelled = $_POST['why_was_policy_cancelled'];
	$paid_losses = $_POST['paid_losses'];
	$amount_requested = $_POST['amount_requested'];
	$amps = $_POST['amps'];
	$does_owner_live_on_property = $_POST['does_owner_live_on_property'];
	$new_or_existing_residence = $_POST['new_or_existing_residence'];
	$type_of_structure = $_POST['type_of_structure'];
	$heating_source = $_POST['heating_source'];
	$coverage_cancelled = $_POST['coverage_cancelled'];
	$license_number = $_POST['license_number'];
	$dob = $_POST['dob'];
	$first_license = $_POST['first_license'];
	$vin_number = $_POST['vin_number'];
	$vehicle_make = $_POST['vehicle_make'];
	$vehicle_model = $_POST['vehicle_model'];
	$vehicle_year = $_POST['vehicle_year'];
	$uninsured_motorist = $_POST['uninsured_motorist'];
	$property_damage = $_POST['property_damage'];
	$bodily_injury = $_POST['bodily_injury'];
	$medical_payments = $_POST['medical_payments'];
	$collision_deductible = $_POST['collision_deductible'];
	$limited_collision_deductible = $_POST['limited_collision_deductible'];
	$comprehensive_deductible = $_POST['comprehensive_deductible'];
	$substitute_transportation = $_POST['substitute_transportation'];
	$towing_and_labor = $_POST['towing_and_labor'];
	$underinsured_motorist = $_POST['underinsured_motorist'];
	$mileage = $_POST['mileage'];
	$alarm = $_POST['alarm'];
	$airbags = $_POST['airbags'];
	$guidepoint = $_POST['guidepoint'];
	$lojack = $_POST['lojack'];
	$onstar = $_POST['onstar'];
	$auto_remarks = $_POST['auto_remarks'];
	$home_remarks = $_POST['home_remarks'];
	$limited_collision_deductible = $_POST['limited_collision_deductible'];
	$body = "
<br><hr><br>
<h2>Personal Information</h2>
Name: $name <br>
SSN: $ssn <br>
Phone: $phone <br>
Email: $email <br>
Street: $street <br>
City: $city <br>
State: $state <br>
Zip: $zip <br>
<h1>Homeowners/Renters Quote Request</h1><br>
<h2>Residence</h2>
Type of insurance: $type_of_insurance <br>
Number of units: $number_of_units <br>
Square footage: $square_footage <br>
Year built: $year_built <br>
Pets: $pets <br>
Updates: $updates <br>
Current insurance company: $current_insurance_company <br>
If policy was cancelled, why?: $why_was_policy_cancelled <br>
Paid losses: $paid_losses <br>
Amount Requested: $amount_requested <br>
I verify that the electrical system is circuit breakers and at least 100 amps: $amps <br>
Does the owner live on the property?: $does_owner_live_on_property <br>
New or existing property?: $new_or_existing_residence <br>
Type of structure: $type_of_structure <br>
Heating source: $heating_source <br>
Has your coverage been cancelled in the last three years?: $coverage_cancelled <br>
Remarks: $home_remarks <br>
<h1>Auto Quote Request</h1><br><br>
<h2>Driver Information</h2>
License number: $license_number <br>
D.O.B.: $dob <br>
Year you received your first license: $first_license <br><br>
<h2>Vehicle Information</h2>
VIN number: $vin_number <br>
Make: $vehicle_make <br>
Model: $vehicle_model <br>
Year: $vehicle_year <br>
<h2>Coverages</h2>
Uninsured Motorist: $uninsured_motorist <br>
Property Damage: $property_damage <br>
Bodily Injury: $bodily_injury <br>
Medical Payments: $medical_payments <br>
Collision Deductible: $collision_deductible <br>
Limitied Collision Deductible: $limited_collision_deductible <br>
Comprehensive Deductible: $comprehensive_deductible <br>
Substitute Transportation: $substitute_transportation <br>
Towing and Labor: $towing_and_labor <br>
Underinsured Motorist: $underinsured_motorist <br>
Mileage: $mileage <br>
What city is the vehicle garaged in?: $city_garaged <br><br>
<h3>Options that your vehicle is equipped with</h3>
Alarm: $alarm <br>
Airbags: $airbags <br>
GuidePoint: $guidepoint <br>
LoJack: $lojack <br>
OnStar: $onstar <br>
Remarks: $auto_remarks <br>
";
$flag = true;
if ( isset($_POST['includeAutoQuote']) && ($_POST['includeAutoQuote'] == 'includeAutoQuote')  ) {
 if(!$name || !$phone || !$email || !$street || !$city || !$state || !$zip || !$license_number || !$dob || !$first_license || !$vin_number || !$vehicle_make || !$vehicle_model ||
!$vehicle_year || !$uninsured_motorist || !$property_damage || !$bodily_injury || !$city_garaged || !$mileage || !$underinsured_motorist) 
	{
		$flag = false;
	}
}

if ( isset($_POST['includeHomeQuote']) && ($_POST['includeHomeQuote'] == 'includeHomeQuote')  ) {
	if(!$name || !$phone || !$email || !$street || !$city || !$state || !$zip || !$type_of_insurance || !$number_of_units || !$square_footage || !$year_built || 
	!$current_insurance_company || !$amps || !$does_owner_live_on_property || !$new_or_existing_residence || !$type_of_structure || !$amount_requested || !$heating_source || 
	!$coverage_cancelled) {
		$flag = false;
	}
}

if($_POST && $flag == true && (isset($_POST['includeHomeQuote']) || isset($_POST['includeAutoQuote']))) {

	// To send HTML mail, the Content-type header must be set

	$headers  = "Content-type: text/html\\r\
";
	
	// Additional headers
	$headers .= "To: samuel.grieve@gmail.com, samuel@searchtransparencysem.com\\r\
";
	$headers .= "From: $email\\r\
";
	$headers .= "Reply-To: $email\\r\
";
    $headers .= "Return-Path: $email\\r\
";

mail($to,$subject,$body,$headers);

$_SESSION['success'] = '1';
header('Location: sent.html');
exit;
}

?>