When constructing the mail function with multiple Emails, People, To, or Recipients in PHP, be sure to use this syntax. It allows you to send multiple emails to multiple people during the mail function.
-
-
$name = $firstname; //senders name
-
-
$name .= ' '.$lastname; //senders name
-
-
$mail = $email; //senders e-mail adress
-
-
-
-
$recipient = "recipientone@wecodethings.com" . ", " //recipients
-
-
$recipient .= " recipienttwo@wecodethings.com" . ", "
-
-
$recipient .= "recipientthree@wecodethings.com";
-
-
-
-
$mail_body = $firstname.' '.$lastname.' Said, <br /> '.$comment.' <br />Phone: '.$phone; //mail body
-
-
-
-
$subject = 'Contact Form.'; //subject
-
-
-
-
$headers = 'MIME-Version: 1.0' . "\r\n";
-
-
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
-
-
-
-
// Additional headers
-
-
$headers .= 'To: recipientone@wecodethings.com <recipientone@wecodethings.com>, recipienttwo@wecodethings.com <recipienttwo@wecodethings.com>, recipientthree@wecodethings.com < recipientthree@wecodethings.com ' . "\r\n";
-
-
$headers .= 'From: no_reply@wecodethings.com <WeCodeThings>' . "\r\n";