tippytarka
Programmer
i've got this little email script that sends an html email to multiple recipients...
only thing, when the email is received, the 'To' header contains all the emails in elist.txt, like so....
i would like the 'To' header to either contain the single email address of just the recipient only ....or remain blank or be replaced with something else like customer ...any suggestions???
cheers!
Code:
<?
// read list of emails from file.
$email_list = file("elist.txt");
// loop through email list
for ($i = 0; $i < count($email_list); $i++) {
$list_loop = $email_list[$i];
$to .= ''.$list_loop.',';
}
$subject = "My email test.";
$message = "Hello, how are you?";
// Content-type header
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
// additional headers
$headers .= "From: xxx <xxx@xxx.com>\r\n";
mail($to,$subject,$message,$headers)
?>
only thing, when the email is received, the 'To' header contains all the emails in elist.txt, like so....
To: paul@test.com, ann@test.com, mark@test.com, henry@test.com
i would like the 'To' header to either contain the single email address of just the recipient only ....or remain blank or be replaced with something else like customer ...any suggestions???
cheers!