All right I've used the help that I've gotten before about this and edited this
function of code I have. Initially the code was meant to mail out a post to every
email that was listed in the database. The problem was that it sent all the emails in
the TO: section of the email. Now being that I didn't want to give out the emails of
everyone on the list, I wanted to instead hardcode the TO: section and then drop all
of the emails from the database into the BCC: section. The problem being now I am
getting a parse error on lines 30. Included are the original code and my
version(which is spitting the error). If anyone can offer any insight as to what I'm
missing or messing up I should say it would be most appericated.
ORIGINAL SECTION OF MAIL FUNCTION:
function postNews () {
// Get input from form, and members name.
global $cookie_username, $headline, $post, $mail;
// check to see if we should send email.
if ($mail == "yes") {
global $setting_site_name, $setting_site_url, $setting_mail_email;
$fhandle = fopen("newstemps/mailpost.tmp", "r") or die("could not open
newstemps/mailpost.tmp");
$mailpost = fread($fhandle, filesize("newstemps/mailpost.tmp"));
fclose ($fhandle);
$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);
$to = "";
$query = mysql_query("SELECT * FROM members");
while ($member = mysql_fetch_array($query)) {
if ($to == "") {$to = $member['email'];}
else {$to .= ", " . $member['email'];}
}
$from = "from: " . $setting_mail_email;
mail ($to, $setting_site_name, $mailpost, $from) or $emailsuccess = "Failure sending
email.";
if ($emailsuccess == "") {$emailsuccess = "Email Sent Successfully.";}
}
MY MODIFIED SECTION (I've set the more exact section I changed in bold & the line
giving me the parse error is listed in red)
function postNews () {
// Get input from form, and members name.
global $cookie_username, $headline, $post, $mail;
// check to see if we should send email.
if ($mail == "yes") {
global $setting_site_name, $setting_site_url, $setting_mail_email;
$fhandle = fopen("newstemps/mailpost.tmp", "r") or die("could not open
newstemps/mailpost.tmp");
$mailpost = fread($fhandle, filesize("newstemps/mailpost.tmp"));
fclose ($fhandle);
$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);
$to = "[EMAIL PROTECTED]";
$from = "from: " . $setting_mail_email;
$bcc = "bcc: ";
$query = mysql_query("SELECT * FROM members");
while ($member = mysql_fetch_array($query)) {
if ($bcc == "") {$bcc = $member['email'];}
else {$bcc .= ", " . $member['email'];}
}
$headers = $from . "\r\n" . $bcc . "\r\n"
mail ($to, $setting_site_name, $mailpost, $headers) or $emailsuccess = "Failure
sending email.";
if ($emailsuccess == "") {$emailsuccess = "Email Sent Successfully.";}
}
Thanks for any insight that anyone might have.