Home: Select · Advertising · Banner Clients · Content · Donations · Downloads · FAQ · Forums · HtAccesser · HTTP Return Codes · Legal Docs · MetAuthors · PHP-Nuke HOWTO · Private Messages · Profile · Recommend Us · Reviews · Rwh Tos · Search · Stories Archive · Submit News · Surveys · Topics · User Guide · Watched Topics · Web Links · Your Account
Help Keep Our Servers Online AND Our Services Free!
Donations Anonymous May-24 Doulos May-15 Webservant May-11 AndyB May-5 Hotdog May-3
Quality Web Hosting For All PHP Applications
Quality PHP Web Host! Great Reviews! Need help setting up your website, installing Apache, PHP, MySQL, or RavenNuke(tm)? Need help customizing or designing scripts? Please contact us via the Contact Us option for further details and pricing.Link to Me There are more Link To Me icons here .
How to allow HTML in the Newsletter
If you want to use HTML, instead of only plain text in the Newsletter from the administration panel, you have to do the following:
Replace the function newsletter_send() in admin/modules/newsletter.php with:
function newsletter_send($title, $content) {
global $user_prefix, $sitename, $dbi, $nukeurl, $adminmail;
$send_html_messages = "yes";
$from = $adminmail;
$subject = "[$sitename Newsletter]: ".stripslashes($title)."";
$content = stripslashes($content);
$content = "$sitename "._NEWSLETTER."\n\n\n$content\n\n-
$sitename "._STAFF."\n\n\n\n\n\n"._NLUNSUBSCRIBE."";
$result = sql_query("select email from ".$user_prefix.
"_users where newsletter='1'", $dbi);
while(list($email) = sql_fetch_row($result, $dbi)) {
$xheaders = "From: " . $sitename . " <" . $adminmail . ">\n";
$xheaders .= "X-Sender: <" . $adminmail . ">\n";
$xheaders .= "X-Mailer: PHP\n"; // mailer
$xheaders .= "X-Priority: 6\n"; // Urgent message!
if ($send_html_messages == "yes") {
$xheaders .= "Content-Type: text/html;
charset=iso-8859-1\n"; // Mime type
}
mail("$email","$subject","$content",$xheaders);
}
Header("Location: admin.php?op=newsletter_sent");
}
and the function massmail_send() with
function massmail_send($title, $content) {
global $user_prefix, $sitename, $dbi, $nukeurl, $adminmail;
$send_html_messages = "yes";
$from = $adminmail;
$subject = "[$sitename]: $title";
$content = stripslashes($content);
$content = ""._FROM.": $sitename\n\n\n\n$content\n\n\n\n-
$sitename "._STAFF."\n\n\n\n"._MASSEMAILMSG."";
$result = sql_query("select email from ".$user_prefix
."_users where uid != '1'", $dbi);
while(list($email) = sql_fetch_row($result, $dbi)) {
$xheaders = "From: " . $sitename . " <" . $adminmail . ">\n";
$xheaders .= "X-Sender: <" . $adminmail . ">\n";
$xheaders .= "X-Mailer: PHP\n"; // mailer
$xheaders .= "X-Priority: 6\n"; // Urgent message!
if ($send_html_messages == "yes") {
$xheaders .= "Content-Type: text/html;
charset=iso-8859-1\n"; // Mime type
}
mail("$email","$subject","$content",$xheaders);
}
Header("Location: admin.php?op=massmail_sent");
}
The changes are in both functions the same: a flag, $send_html_messages, is checked and if set to "yes", the headers of the Newsletter mails (stored in the $xheaders variable) get an extra line
for the MIME type:
Content-Type: text/html; charset=iso-8859-1
See also HTML Newsletter , but be warned that the code presented in that link, may not escape double quotes, probabbly due to an
upgrade bug in the forums.