On Monday 25 March 2002 15:31, anti-blank wrote: > I've got this script here to send out a mail whenever I enter an update to > my site to my mailing list. The problem is it wants to dump everyone's > email into the To field, and since I don't want to give my users email > addresses away I need to convert this to the bcc field. Below is the > original code and then the modification that I made (which doesn't seem to > work). Also if anyone has any idea how to include in this block a line to > tell php to send this as HTML email as well that would be even more > helpful. Thanks.
[snip] > My MODIFIED CODE: > $mailpost = $mailpost; > $mailpost = str_replace("{setting_site_name}", $setting_site_name, > $mailpost); $mailpost = str_replace("{setting_site_url}", > $setting_site_url, $mailpost); $mailpost = > str_replace("{setting_mail_email}", $setting_mail_email, $mailpost); > $mailpost = str_replace("{post_poster}", $cookie_username, $mailpost); > $mailpost = str_replace("{post_headline}", $headline, $mailpost); > $mailpost = str_replace("{post_date}", date("M d, Y", time()), $mailpost); > $mailpost = str_replace("{post_post}", $post, $mailpost); > $bcc = ""; > $query = mysql_query("SELECT * FROM members"); > while ($member = mysql_fetch_array($query)) { > if ($bcc == "") {$bcc = $member['email'];} > else {$bcc .= ", " . $member['email'];} > } > $from = "from: " . $setting_mail_email; > mail ($bcc, $setting_site_name, $mailpost, $from) or $emailsuccess = > "Failure sending email."; if ($emailsuccess == "") {$emailsuccess = "Email > Sent Successfully.";} } Forgive me if I'm wrong, but all it seems you have done is used a different variable name to hold the list of recipients (from $to to $bcc). That in itself is hardly likely to change the behaviour of mail() to do what you want. Read the manual *again* (you have already read it haven't you?) for how to use cc: and bcc: in mail(). -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* After your lover has gone you will still have PEANUT BUTTER! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php