Scusatemi ancora, ma neppure corretto funziona...
Provo con un altro codice e mi sorge il dubbio che le impostazioni dell'apache siano in un altro file...
Lo so che sono incapace... non mi era mai successo di aver problemi
Codice PHP:
<?php
require ("./global.php");
class send extends tools {
function getNews($newsid, $from) {
$query = parent::query("SELECT
n.*,
u.username
FROM nm_news n
LEFT JOIN nm_users u on n.userid=u.userid
WHERE n.newsid='".$newsid."'");
$row = parent::fetch_array($query);
$row["title"] = trim(stripslashes($row["title"]));
$row["text"] = trim(stripslashes($row["text"]));
$news_split = preg_split("/(\[more\])/", $row["text"]);
if ($row["text"] != $news_split[0]) {
$news_split[0].= $this->lang["More"]."...";
}
$row["text"] = $news_split[0];
$row["time"] = parent::format_date($row["time"]);
$row["text"] = parent::strip_bbcode($row["text"]);
$email_text .= $this->lang["You have received this message because"]." ".$from." ".$this->lang["send you this"];
$email_text .= "\n\n*** ".$row["title"]." (".$this->config["scripturl"]."/index.php?shownews=".$row["newsid"].")";
$email_text .= "\n".$row["time"]." ".$this->lang["by"]." ".$row["username"];
$email_text .= "\n\n".$row["text"]."\n";
return $email_text;
}
}
/* __MAIN__ */
$send = new send;
$smarty->display('header.tpl');
if ($_POST["newsid"] != "") {
if ($_POST["from"] != "" and $_POST["to"] != "") {
if ($send->config["smtp_enable"]) {
require ("./include/smtp.php");
$mail = new nm_smtp;
$mail->host = $send->config["smtp_host"];
$mail->user = $send->config["smtp_user"];
$mail->pass = $send->config["smtp_pass"];
$mail->from = $send->config["smtp_from"];
$mail->name = $send->config["smtp_name"];
$mail->encode = $send->lang["contenttype"];
$mail->hostname = $_SERVER["SERVER_ADDR"];
$mail->silent = true;
$mail->open();
$mail->auth();
}
if ($send->config["smtp_enable"]) {
$mail->sendmail($_POST["to"], $lang["News at"]." ".$send->config["title"], $send->getNews($_POST["newsid"], $_POST["from"]));
} else {
mail($_POST["to"], $lang["News at"]." ".$send->config["title"], $send->getNews($_POST["newsid"], $_POST["from"]), "From: ".$_POST["from"]);
}
if ($send->config["smtp_enable"]) {
$mail->quit();
}
$smarty->display('send_redirect.tpl');
} else {
$smarty->display('error_emptyfields.tpl');
}
} else {
$smarty->assign('PHP_SELF', $_SERVER["PHP_SELF"]);
$smarty->assign('newsid', $_GET["newsid"]);
$smarty->display('send.tpl');
}
$smarty->display('footer.tpl');
?>
Grazie mille