"); for($index = 0; $index < count($toemails); $index++) { $y = $contents; //$y .= "\n http://www.php-scripts.com/php_diary/unsubscribe.php3?ID=$toemails[$index]"; $toemails[$index] = ereg_replace("\n", "", $toemails[$index]); mail($toemails[$index], $subject, $y, $from_header); print("$toemails[$index]..."); } print("DONE"); } else { // mail to only one recipient $to email address $contents .= "http://www.php-scripts.com/php_diary/unsubscribe.php3?id=$to"; mail($to, $subject, $contents, $from_header); print("Sending email to...$to
DONE"); } $text = "

Email message sent was
$contents"; print(nl2br($text)); ?>