| Server IP : 89.46.109.6 / Your IP : 216.73.216.84 Web Server : Apache System : Linux hlpi1ws-c284v20.ad.aruba.it 6.8.0-139-generic #139-Ubuntu SMP PREEMPT_DYNAMIC Sat Aug 1 03:52:05 UTC 2026 x86_64 User : ID19067310 ( 19067310) PHP Version : 5.3.29 Disable Function : system,popen,dl,passthru,proc_open,shell_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /web/htdocs/www.edizacco.it/home/pannello/ |
Upload File : |
<?php
ob_start();
@session_start();
require_once('../include/connect_db.php');
include('include/sessione.inc.php');
require_once('include/templates.php');
//require_once('include/newsletter_templates.php');
// GESTIONE PAGINA
if ( isset($_REQUEST['action']) ) { $action = $_REQUEST['action']; } else { $action = "index"; }
switch ($action) {
case 'index': index(); break;
case 'newsletter_save': newsletter_save(); break;
case 'newsletter_duply': newsletter_duply(); break;
case 'newsletter_delete': newsletter_delete(); break;
case 'categorie_save': categorie_save(); break;
case 'categorie_delete': categorie_delete(); break;
case 'utente_save': utente_save(); break;
case 'utente_delete': utente_delete(); break;
case 'invio': invio(); break;
default: index(); break;
}
///////////////////////////////////////////////////////////////////////////////////////////
/// INDEX /////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function index(){ }
///////////////////////////////////////////////////////////////////////////////////////////
/// NEWSLETTER SAVE ///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function newsletter_save(){
$prefix = PREFIX;
$directory = NEWSLETTERDIRECTORY;
$act = $_POST['act'];
$tipo = $_POST['tipo'];
$titolo = ucfirst(addslashes($_POST['titolo']));
$testo = addslashes($_POST['testo']);
if( $act == 'add' ) {
$data = date('Y-m-d G:i:s');
$insert = "INSERT INTO ".$prefix."_newsletter (titolo, testo, stato, data) VALUES ('$titolo', '$testo', '0', '$data')";
echo'<h1>GESTIONE NEWSLETTER > <b>NUOVA NEWSLETTER</b></h1>';
if(mysql_query($insert)){ }else{ echo status_errore(); }
$id_newsletter = mysql_insert_id();
// UPLOAD IMMAGINE /////////////////////////////////
if ( isset($_FILES['immagine']) && !empty($_FILES['immagine']['name']) ) {
$error_immagine = "";
$prefix_immagine = 'newsletter_'.$id_newsletter.'_'.$_FILES['immagine']['name'];
$public_immagine = '../'.$directory.'/'.$prefix_immagine;
if ( empty($error_immagine) ) {
move_uploaded_file($_FILES['immagine']['tmp_name'], $public_immagine);
mysql_query("UPDATE ".$prefix."_newsletter SET immagine = '$prefix_immagine' WHERE id_newsletter = '$id_newsletter'");
} else { die($error_immagine); }
}
// UPLOAD IMMAGINE /////////////////////////////////
}elseif( $act == 'edit' ){
$id_newsletter = $_POST['id_newsletter'];
$del_img = $_POST['del_img'];
$update = "UPDATE ".$prefix."_newsletter SET titolo = '$titolo', testo = '$testo' WHERE id_newsletter = '$id_newsletter'";
echo'<h1>GESTIONE NEWSLETTER > <b>MODIFICA NEWSLETTER</b></h1>';
if(mysql_query($update)){ }else{ echo status_errore(); }
// UPLOAD IMMAGINE /////////////////////////////////
if ($del_img == '1') {
$del_img_1 = mysql_query("SELECT * FROM ".$prefix."_newsletter WHERE id_newsletter = '$id_newsletter'");
while ( $row_del_img_1 = @mysql_fetch_array($del_img_1) ) { $immagine = $row_del_img_1['immagine']; unlink('../'.$directory.'/'.$immagine.''); }
mysql_query("UPDATE ".$prefix."_newsletter SET immagine = '' WHERE id_newsletter = '$id_newsletter'");
}else{ echo''; }
if ( isset($_FILES['immagine']) && !empty($_FILES['immagine']['name']) ) {
$error_immagine = "";
$prefix_immagine = 'newsletter_'.$id_newsletter.'_'.$_FILES['immagine']['name'];
$public_immagine = '../'.$directory.'/'.$prefix_immagine;
if ( empty($error_immagine) ) {
$del_img_2 = mysql_query("SELECT * FROM ".$prefix."_newsletter WHERE id_newsletter = '$id_newsletter'");
while ( $row_del_img_2 = @mysql_fetch_array($del_img_2) ) { $immagine = $row_del_img_2['immagine']; if ( $immagine != "" ) { unlink('../'.$directory.'/'.$immagine.''); } }
move_uploaded_file($_FILES['immagine']['tmp_name'], $public_immagine);
mysql_query("UPDATE ".$prefix."_newsletter SET immagine = '$prefix_immagine' WHERE id_newsletter = '$id_newsletter'");
} else { die($error_immagine); }
}
// UPLOAD IMMAGINE /////////////////////////////////
}
header("Location: gestione_newsletter.php?action=newsletter&tipo=$tipo");
ob_end_flush();
}
///////////////////////////////////////////////////////////////////////////////////////////
/// NEWSLETTER DUPLY //////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function newsletter_duply(){
$prefix = PREFIX;
$directory = NEWSLETTERDIRECTORY;
$tipo = $_POST['tipo'];
$id_newsletter = isset($_GET['id_newsletter']) ? (int)$_GET['id_newsletter'] : 0;
$carica = mysql_query("SELECT * FROM ".$prefix."_newsletter WHERE id_newsletter = '$id_newsletter'");
while ( $row_carica = @mysql_fetch_array($carica) ) {
$titolo = 'DUPLICATO - '.addslashes($row_carica['titolo']);
$testo = addslashes($row_carica['testo']);
$data = date('Y-m-d G:i:s');
$immagine = addslashes($row_carica['immagine']);
if($immagine != ""){
$server_immagine = '../'.$directory.'/'.$immagine.'';
$db_immagine = 'dup_'.$immagine.'';
copy($server_immagine, "../".$directory."/".$db_immagine); //Copia in /temp/text.txt
}else{ }
}
$insert = "INSERT INTO ".$prefix."_newsletter (titolo, testo, data, immagine, stato) VALUES ('$titolo', '$testo', '$data', '$db_immagine', '0')";
echo'<h1>GESTIONE NEWSLETTER > <b>DUPLICA NEWSLETTER</b></h1>';
if(mysql_query($insert)){ }else{ echo status_errore(); }
header("Location: gestione_newsletter.php?action=newsletter&tipo=$tipo");
ob_end_flush();
}
///////////////////////////////////////////////////////////////////////////////////////////
/// NEWSLETTER DELETE /////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function newsletter_delete(){
$prefix = PREFIX;
$directory = NEWSLETTERDIRECTORY;
$tipo = $_POST['tipo'];
$id_newsletter = isset($_GET['id_newsletter']) ? (int)$_GET['id_newsletter'] : 0;
$carica = mysql_query("SELECT * FROM ".$prefix."_newsletter WHERE id_newsletter = '$id_newsletter'");
while ( $row_carica = @mysql_fetch_array($carica) ) {
$immagine = $row_carica['immagine']; if ( $immagine != "" ) { unlink('../'.$directory.'/'.$immagine.''); }
}
$delete = "DELETE FROM ".$prefix."_newsletter WHERE id_newsletter = '$id_newsletter'" ;
echo'<h1>GESTIONE NEWSLETTER > <b>ELIMINA NEWSLETTER</b></h1>';
if(mysql_query($delete)){ }else{ echo status_errore(); }
header("Location: gestione_newsletter.php?action=newsletter&tipo=$tipo");
ob_end_flush();
}
///////////////////////////////////////////////////////////////////////////////////////////
/// CATEGORIE SAVE ////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function categorie_save(){
$prefix = PREFIX;
$act = $_POST['act'];
$categoria = ucfirst(addslashes($_POST['categoria']));
if( $act == 'add' ) {
$insert = "INSERT INTO ".$prefix."_newsletter_categoria (categoria) VALUES ('$categoria')";
echo'<h1>GESTIONE NEWSLETTER > ELENCO CATEGORIE > <b>NUOVA CATEGORIA</b></h1>';
if(mysql_query($insert)){ }else{ echo status_errore(); }
}elseif( $act == 'edit' ){
$id_categoria = $_POST['id_categoria'];
$update = "UPDATE ".$prefix."_newsletter_categoria SET categoria = '$categoria' WHERE id_categoria = '$id_categoria'";
echo'<h1>GESTIONE NEWSLETTER > ELENCO CATEGORIE > <b>MODIFICA CATEGORIA</b></h1>';
if(mysql_query($update)){ }else{ echo status_errore(); }
}
header("Location: gestione_newsletter.php?action=categorie");
ob_end_flush();
}
///////////////////////////////////////////////////////////////////////////////////////////
/// CATEGORIE DELETE //////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function categorie_delete(){
$prefix = PREFIX;
$id_categoria = isset($_GET['id_categoria']) ? (int)$_GET['id_categoria'] : 0;
echo'<h1>GESTIONE NEWSLETTER > ELENCO CATEGORIE > <b>ELIMINA CATEGORIA</b></h1>';
$delete_utenti = "DELETE FROM ".$prefix."_newsletter_utenti WHERE id_categoria = '$id_categoria'" ;
if(mysql_query($delete_utenti)){ }else{ echo status_errore(); }
$delete_categoria = "DELETE FROM ".$prefix."_newsletter_categoria WHERE id_categoria = '$id_categoria'" ;
if(mysql_query($delete_categoria)){ }else{ echo status_errore(); }
header("Location: gestione_newsletter.php?action=categorie");
ob_end_flush();
}
///////////////////////////////////////////////////////////////////////////////////////////
/// UTENTE SAVE ///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function utente_save(){
$prefix = PREFIX;
$act = $_POST['act'];
$cognome = ucfirst(addslashes($_POST['cognome']));
$nome = ucfirst(addslashes($_POST['nome']));
$indirizzo = ucfirst(addslashes($_POST['indirizzo']));
$citta = ucfirst(addslashes($_POST['citta']));
$id_provincia = $_POST['id_provincia'];
$cellulare = addslashes($_POST['cellulare']);
$id_categoria = $_POST['id_categoria'];
$email = addslashes($_POST['email']);
if( $act == 'add' ) {
$insert = "INSERT INTO ".$prefix."_newsletter_utenti (cognome, nome, indirizzo, citta, id_provincia, cellulare, id_categoria, email) VALUES ('$cognome', '$nome', '$indirizzo', '$citta', '$id_provincia', '$cellulare', '$id_categoria', '$email')";
echo'<h1>GESTIONE NEWSLETTER > ELENCO UTENTI > <b>NUOVO UTENTE</b></h1>';
if(mysql_query($insert)){ }else{ echo status_errore(); }
}elseif( $act == 'edit' ){
$id_utente = $_POST['id_utente'];
$update = "UPDATE ".$prefix."_newsletter_utenti SET cognome = '$cognome', nome = '$nome', indirizzo = '$indirizzo', citta = '$citta', id_provincia = '$id_provincia', cellulare = '$cellulare', id_categoria = '$id_categoria', email = '$email' WHERE id_utente = '$id_utente'";
echo'<h1>GESTIONE NEWSLETTER > ELENCO UTENTI > <b>MODIFICA UTENTE</b></h1>';
if(mysql_query($update)){ }else{ echo status_errore(); }
}
header("Location: gestione_newsletter.php?action=utente");
ob_end_flush();
}
///////////////////////////////////////////////////////////////////////////////////////////
/// UTENTE DELETE /////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function utente_delete(){
$prefix = PREFIX;
$id_utente = isset($_GET['id_utente']) ? (int)$_GET['id_utente'] : 0;
echo'<h1>GESTIONE NEWSLETTER > ELENCO UTENTI > <b>ELIMINA UTENTE</b></h1>';
$delete_utenti = "DELETE FROM ".$prefix."_newsletter_utenti WHERE id_utente = '$id_utente'" ;
if(mysql_query($delete_utenti)){ }else{ echo status_errore(); }
header("Location: gestione_newsletter.php?action=utente");
ob_end_flush();
}
///////////////////////////////////////////////////////////////////////////////////////////
/// INVIO /////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
function invio(){
$prefix = PREFIX;
$tipo = $_POST['tipo'];
$select = $_POST['select'];
$id_newsletter = isset($_POST['id_newsletter']) ? (int)$_POST['id_newsletter'] : 0;
$prefix = PREFIX;
$send_smtp = SENDSMTP;
$send_email = SENDEMAIL;
$send_password = SENDPASSWORD;
$send_ricezione = SENDRICEZIONE;
$send_from = SENDFROM;
$server = SERVER;
$directory = NEWSLETTERDIRECTORY;
$h1 = NEWSLETTERH1;
$h2 = NEWSLETTERH2;
$h3 = NEWSLETTERH3;
$mesi = array(1=>'gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre','dicembre');
list($sett,$giorno,$mese,$anno) = explode('-',date('w-d-n-Y'));
$carica_newsletter = mysql_fetch_assoc(mysql_query("SELECT * FROM ".$prefix."_newsletter WHERE id_newsletter = '$id_newsletter'"));
$titolo = stripslashes($carica_newsletter['titolo']);
$testo = stripslashes($carica_newsletter['testo']);
if( stripslashes($carica_newsletter['immagine']) != "" ){ $tag_img = '<img src="'.$server.'/'.$directory.'/'.stripslashes($carica_newsletter['immagine']).'" width="510" style="margin: 0 0 5px 0; padding: 0; display: block;" alt="">'; }else { $tag_img = ''; }
$newsletter ='<title>'.$oggetto.'</title><style type="text/css"> body { margin: 0;padding: 0; background-color: #878c80; background-image: url('.$server.'/images/newsletter/body-bg.jpg); background-repeat: repeat; } h1 { font-family: Georgia, \'Times New Roman\', Times, serif; margin: 0; padding: 0; color: #FFF; text-shadow: -1px -1px 1px #a10e08; font-size: 24px; text-transform: uppercase; } h2 { font-family: Georgia, \'Times New Roman\', Times, serif; font-size: 14px; margin: 0; padding: 0; color:#FFF; text-transform: uppercase; } h3 { font-family: Georgia, \'Times New Roman\', Times, serif; font-size: 14px; margin: 20px 0 0 0; padding: 0; color:#e7edcf; text-align:left; } h4 { font-family: Georgia, \'Times New Roman\', Times, serif; margin: 0; padding: 0; color: #000; font-size: 24px; text-shadow: 1px 1px 1px #FFFFFF; } p { font-family: Georgia, \'Times New Roman\', Times, serif; font-size: 14px; color:#333; font-weight: normal; text-align:justify; padding-top: 0; padding-right: 0; padding-bottom: 0px; padding-left: 0; margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; } a { color: #036; text-decoration: none; } .data_giorno { font-family: Georgia, \'Times New Roman\', Times, serif; font-size: 14px; color: #F00; margin-bottom: 0px; margin-top: 0px; padding: 0px; -webkit-text-size-adjust: none; clear: both; font-weight: bold; text-align: center; } .data_mese { font-family: Georgia, \'Times New Roman\', Times, serif; font-size: 14px; color: #666; margin-bottom: 0px; margin-top: 0px; padding: 0px; text-shadow: 1px 1px 1px #FFFFFF; -webkit-text-size-adjust: none; clear: both; font-weight: bold; text-align: center; text-transform: capitalize; } .data_anno { font-family: Georgia, \'Times New Roman\', Times, serif; font-size: 24px; color: #999; margin-bottom: 0px; margin-top: 0px; padding: 0px; text-shadow: 1px 1px 1px #FFFFFF; -webkit-text-size-adjust: none; clear: both; text-align: center; } .footer { font-family: Georgia, \'Times New Roman\', Times, serif; font-size: 11px; color:#bcc1ae; font-weight: normal; text-align:justify; padding: 0; margin: 0; } .nomail { font-family: Georgia, \'Times New Roman\', Times, serif; font-size: 11px; color:#FFFFFF; font-weight: normal; text-align:center; padding: 0; margin: 0; } </style> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr><td bgcolor="#d8e7ea" style="background-color: #878c80; background-image: url('.$server.'/images/newsletter/body-bg.jpg); background-repeat: repeat;"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td height="20" align="center" class="nomail">Se non visualizzi correttamente questa newsletter <a href="'.$server.'/anteprima_newsletter.php?id_newsletter='.$id_newsletter.'">clicca qui</a></td></tr></table><table bgcolor="#d4d2c5" background="'.$server.'/images/newsletter/full-bg-top.jpg" width="600" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td valign="top" width="15" height="147"><img style="margin: 0; padding: 0; display: block;" src="'.$server.'/images/newsletter/left-top-curl.jpg" width="15" height="147"></td><td valign="top" height="100"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="386" height="23"></td><td width="34"></td><td width="102"></td><td width="48"></td></tr><tr><td valign="top" height="124" background="'.$server.'/images/newsletter/top-intro-bg.jpg" bgcolor="#dd2d1d"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="409" height="19"></td></tr><tr><td valign="top"><h1>'.$h1.'</h1><h2>'.$h2.'</h2><h3>'.$h3.'</h3></td></tr></table></td><td valign="top"> <img src="'.$server.'/images/newsletter/bracket-red.png" width="34" height="124" style="margin: 0; padding: 0; display: block;"> </td><td valign="top"><table width="100%" border="0" align="left" cellpadding="0" cellspacing="0"><tr><td valign="top" height="12" align="center"></td></tr><tr><td height="30" align="center"><table width="27" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" align="center" height="27" bgcolor="#b7b7ac" background="'.$server.'/images/newsletter/date-bg-2.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="3"></td></tr></table><p class="data_giorno"><currentday>'.date('d').'</p></td></tr></table></td></tr><tr><td valign="bottom" height="19" align="center"><img style="margin: 0; padding: 0;" src="'.$server.'/images/newsletter/ornament.gif" width="76" height="19"> </td></tr><tr><td height="20" align="center"><p class="data_mese"><currentmonthname>'.$mesi[$mese].'</p></td></tr><tr><td align="center"><p class="data_anno"><currentyear>'.date('Y').'</p></td></tr></table></td><td align="right" valign="top"><img style="margin: 0; padding: 0; display: block;" src="'.$server.'/images/newsletter/bracket-green.png" width="48" height="124"></td></tr></table></td><td valign="top" width="15" height="147"><img style="margin: 0; padding: 0; display: block;" src="'.$server.'/images/newsletter/right-top-curl.jpg" width="15" height="147"></td></tr></table><table width="600" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td valign="top" width="15"> <img style="margin: 0; padding: 0; display: block;" src="'.$server.'/images/newsletter/left-curl-part-1.jpg" width="15" height="56"></td><td background="'.$server.'/images/newsletter/full-bg.jpg" bgcolor="#d4d2c5" valign="top"><table width="569" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" width="30"><table width="20" border="0" cellpadding="0" cellspacing="0"><tr><td height="27"></td></tr><tr><td><img style="margin: 0; padding: 0; display: block;" src="'.$server.'/images/newsletter/left-curl-part-2.gif" width="12" height="28"></td></tr></table></td><td valign="top"><table width="510" border="0" cellspacing="0" cellpadding="0"><tr><td height="23"></td></tr><tr><td><h4>'.$titolo.'</h4><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="15"></td></tr></table><p>'.$tag_img.'</p><p>'.$testo.'</p></td></tr></table></td></tr></table><table width="100%" border="0" align="left" cellpadding="0" cellspacing="0"><tr><td background="'.$server.'/images/newsletter/full-bg.jpg" bgcolor="#d4d2c5" width="348"> </td></tr></table><table width="100%" border="0" align="left" cellpadding="0" cellspacing="0"><tr><td background="'.$server.'/images/newsletter/full-bg.jpg" bgcolor="#d4d2c5" width="348"></td></tr></table></td><td style="background-color: none;" bgcolor="" valign="top" width="15"> </td></tr></table><table width="600" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td width="18"></td><td width="566"><p class="footer">Ricevi questa e-mail in quanto risulti iscritto alla newsletter di '.$link_no_www.' dove hai acconsentito esplicitamente a ricevere informazioni e/o comunicazioni da parte nostra. <br></p><p class="footer"> </p><p class="footer">Se non desideri piu\' ricevere email clicca <a href="'.$server.'/newsletter.php?action=cancellami">qui</a>.</p><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="20"></td></tr></table></td><td width="16"> </td></tr></table></td></tr></table>';
require "phpmailer/class.phpmailer.php";
if( $select == "cat" ){
$id_categoria = $_POST['id_categoria'];
if( $id_categoria == "0" ){ $tag_where = ""; }else{ $tag_where = "WHERE id_categoria = '$id_categoria'"; }
$query = mysql_query("SELECT * FROM ".$prefix."_newsletter_utenti $tag_where ");
echo'<b>ID CATEGORIA:</b> '.$id_utente.'<br />';
while ( $row = @mysql_fetch_array($query, MYSQL_ASSOC) ) {
$to = $row['email'];
/// INVIO EMAIL ///////////////////////////////////////////////
$mail = new PHPmailer();
$mail->IsSMTP();
$mail->IsHTML(true);
$mail->Mailer = "smtp";
$mail->Host = $send_smtp;
$mail->Port = 25;
$mail->Username = $send_email;
$mail->Password = $send_password;
$mail->SMTPAuth = true;
$mail->From = $send_ricezione;
$mail->FromName = $send_from;
$mail->AddAddress(''.$to.'');
$mail->AddReplyTo(''.$send_ricezione.'');
$mail->Subject = ''.$titolo.'';
$mail->Body = $newsletter; //inseriamo i tag HTML e i CSS per formattare il messaggio
//parte relativa all'invio
if(!$mail->Send()){ // ERRRORE INVIO
header("Location: gestione_newsletter.php?action=result_invio&status=error&tipo=$tipo&id_newsletter=$id_newsletter");
ob_end_flush();
// INVIO RIUSCITO
}else{ echo''; }
$mail->ClearAddresses(); // elimino i destinatari
$mail->SmtpClose();
unset($mail);
/// INVIO EMAIL ///////////////////////////////////////////////
}
}elseif( $select == "utenti" ){
$count = count($_POST['check'.$i]);
if (isset($_POST['check'.$i])) {
$error = "";
foreach ($_POST['check'.$i++] as $_POST['check'.$i]) {
if ( empty($error) ) {
$id_utente = $_POST['check'.$i];
$query = mysql_query("SELECT * FROM ".$prefix."_newsletter_utenti WHERE id_utente = '$id_utente'");
echo'<b>ID UTENTE:</b> '.$id_utente.'<br />';
while ( $row = @mysql_fetch_array($query, MYSQL_ASSOC) ) {
$to = $row['email'];
echo'EMAIL: '.$to.'<br />';
/// INVIO EMAIL ///////////////////////////////////////////////
$mail = new PHPmailer();
$mail->IsSMTP();
$mail->IsHTML(true);
$mail->Mailer = "smtp";
$mail->Host = $send_smtp;
$mail->Port = 25;
$mail->Username = $send_email;
$mail->Password = $send_password;
$mail->SMTPAuth = true;
$mail->From = $send_ricezione;
$mail->FromName = $send_from;
$mail->AddAddress(''.$to.'');
$mail->AddReplyTo(''.$send_ricezione.'');
$mail->Subject = ''.$titolo.'';
$mail->Body = $newsletter; //inseriamo i tag HTML e i CSS per formattare il messaggio
//parte relativa all'invio
if(!$mail->Send()){ // ERRRORE INVIO
header("Location: gestione_newsletter.php?action=result_invio&status=error&tipo=$tipo&id_newsletter=$id_newsletter");
ob_end_flush();
// INVIO RIUSCITO
}else{ echo''; }
$mail->ClearAddresses(); // elimino i destinatari
$mail->SmtpClose();
unset($mail);
/// INVIO EMAIL ///////////////////////////////////////////////
}
} else { die($error); }
}
}
}
header("Location: gestione_newsletter.php?action=result_invio&status=success&tipo=$tipo&id_newsletter=$id_newsletter");
ob_end_flush();
}
?>