Here is my php so far
$headers = "From: webinquiries@someplace.com
";
$headers .= "Reply-To: sales@someplace.com
";
$headers .= 'Bcc: someone@someplace.com' . "
";
$headers .= "MIME-Version: 1.0
";
$headers .= "Content-Type: text/plain; charset=ISO-8859-1
";
mail($to, $subject, $body, $headers);
how do i add three more email addresses to this list
Create an array of email addresses, loop through each item in the array and call the mail()
function. Or submit a comma separated list like so User <user@example.com>, Another User <anotheruser@example.com>
.
If your emailing 'needs' require sending an extensive amount of emails, you might want to look into some third party libraries, as the mail
function is very 'delicate'.
Use something like Swiftmailer or PHPMailer - they eliminate the hard work in creating MIME-based emails, and allow any number of To/CC/BCC addresses in any combination.
You can pass a string with comma-separated e-mail addresses, or any other string that complies with RFC 2822.
Please read the mail function documentation in the PHP manual.