My friend aks me to help him with some issue on his small website. Since some time no one from his subscribers receives his e-mails, except himself and in addition many times (I guess that his address is defined as BBC in send_mail function so inf fact he will receive all e-mails sent from his website?).
Below I am attaching function which is responsible for such feature, made by someone who prepared this website years ago. I am beginner, I tried to solve this issue but without success. I guess it's something with that loop?
function admin_send_email_news($news_id, $subject, $limit_start = NULL, $limit_offset = NULL){
// get news
$row = admin_get_news_for_id($news_id);
$news_content_short = $row["news_content_short"];
$news_content = $row["news_content"];
try {
$result2 = mysql_query("SELECT user_email FROM h_user WHERE blocked_user='false' AND user_consent='true'");
while ($row2 = mysql_fetch_array($result2)) {
try {
send_mail($row2["user_email"], $subject,
$news_content_short . $news_content);
} catch (Exception $e) {}
}
if (is_null($limit_start) || is_null($limit_offset)) {
return false;
} else {
return ($count == $limit_offset);
}
} catch (Exception $e) {
error_user("Error while sending message " . $e->getMessage());
}
return false;
}