%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/
Upload File :
Create Path :
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/a-newsletter_interne_mail.php

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

verif_co_admin();

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

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

echo $_POST['num'];
if($_POST['num'] == 1)
{
	$debut = 0;
}
else {
	$debut = (($_POST['num']-1)*10);
}
$inpart="";
foreach($_POST['part_ed'] as $unpart){
	$inpart.=$unpart.',';
}
$inpart=trim($inpart,',');
if($inpart==""){
	$this_edition=$edition->getCurrentEdition();
	$inpart=$this_edition['id'];
}

$query = "SELECT * FROM `user` u LEFT JOIN `section_edition` s ON s.section=u.section WHERE s.edition IN (".$inpart.") AND s.valide=1 AND lang = ".$_POST['lang']." LIMIT ".$debut.",10";

$result = $db->q($query);
while ($data = mysql_fetch_assoc($result))
{
	$subject="=?UTF-8?B?".base64_encode(stripslashes($_POST['titre']))."?=";
	$headers= "From: \"SEDL\" <".$email_noreply.">\n";
	$headers.='Content-type: text/html; charset=utf-8';
	$message = str_replace("#IDUSER#", $data['id'] * 561, $message);
	//mail($data['email'], $subject, $message, $headers);
	//mail("matthieu@alnetis.fr", $subject, $message, $headers);
	$mail = new PHPMailer();
	$mail->CharSet = 'UTF-8';
    $mail->From = $email_noreply;
	$mail->FromName = "ONE in FIVE – Congress";
	$mail->Subject = base64_encode(stripslashes($_POST['titre']));
	$mail->MsgHTML($message);
 
    $mail->AddAddress($data['email']);
	$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