Click to See Complete Forum and Search --> : Email HTML With Multiple Email Receipents


phpnstuff
06-01-2006, 11:33 AM
The below code is an example of what will be emailed to my clients.

The previous page will be a simple form with one field called "email_list".
I'm going to input multiple email addresses seperated by an ";" (email1@company.com; email2@company.com; email3@company.com)

Here is the part where i'm totally lost, when they hit submit, how can I tell the code below to send this to every email receipent in an array/loop until its finished, after display a message, "All Emails Have Been Sent"?

Thanks for you help!


<?php

$to = "$email_list";
$subject = "E-Newsletter";
$headers = "To: $email_list <$email_list>\r\n";
$headers = "From: Company <noreply@company.com>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = "<html>\n";
$message .= "<head>\n";
$message .= "<title>Test</title>\n";
$message .= "</head>\n";
$message .= "<body>\n";
$message .= "</body>\n";
$message .= "</html>\n";

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

?>