"; $ini.='execution_time = ' . ini_get('max_execution_time') . "
"; set_time_limit(300); $ini.='execution_time = ' . ini_get('max_execution_time') . "
"; //die($ini); $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $starttime = $mtime; //Your Script Content here include_once('classes/class.Db.php'); $db=new Db(); //die(); $m=memory_get_usage()."
"; include_once('classes/class.Log.php'); $log=new Log($db); echo $m.memory_get_usage()."
"; include_once('classes/class.Boletin.php'); echo 'Boletin
'.memory_get_usage()."
"; include_once('classes/class.BoletinTrack.php'); echo 'BoletinTrack
'.memory_get_usage()."
"; include_once('phpmailer/class.phpmailer.php'); echo 'phpmailer
'.memory_get_usage()."
"; include_once('phpmailer/class.smtp.php'); echo 'smtp
'.memory_get_usage()."
"; $boletin=new Boletin($db); echo 'instBoletin
'.memory_get_usage()."
"; $SQL="SELECT t1.mail_boletin_id AS bol,t2.email,t2.id AS user_id,t3.subjet FROM mail_outbox t1 INNER JOIN mail_suscriptos t2 ON (t1.mail_suscriptos_id=t2.id) INNER JOIN mail_boletin t3 ON (t1.mail_boletin_id=t3.id) WHERE 1 AND t2.estado=1 LIMIT 100;"; //die($SQL); // ORDER BY t3.id DESC $r_bol=$db->query($SQL); /*MODIFICAMOS PARA CHECKEAR MEMORIA */ while($bol=mysql_fetch_assoc($r_bol)){ if($n_server>1){ $n_server=0; } $track=new BoletinTrack($db); $id=$track->get_track($bol['user_id'],$bol['email'],$bol['bol']); $track->re_track($id); //echo $bol['email'].' estado de envío:'; $bol_id=$bol['bol']; $cad=$boletin->show_boletin($bol['bol']); //die($cad); $mail = new PHPMailer(); $mail->XMailer='AfterLogic WebMail PHP'; $SQL="SELECT mail_templates_id AS id FROM mail_boletin WHERE id=$bol_id"; $r=$db->query($SQL); $rs=mysql_fetch_assoc($r); $template_id=$rs['id']; $SQL="SELECT * FROM mail_template_img WHERE mail_templates_id=$template_id"; $r=$db->query($SQL); while($rs=mysql_fetch_assoc($r)){ $cad=str_replace('mail_img.php?id='.$rs['id'],"cid:template_img_".$rs['id'],$cad);//*/ $mail->AddEmbeddedImage('_guia_skadmin/'.$rs['url'], 'template_img_'.$rs['id'],$rs['original_name'],'base64',$rs['mime']); } $SQL="SELECT * FROM mail_img WHERE mail_boletin_id=$bol_id"; $r=$db->query($SQL); while($rs=mysql_fetch_assoc($r)){ $cad=str_replace('mail_boletin_preview_img.php?id='.$rs['id'],"cid:mail_img_".$rs['id'],$cad);//*/ $mail->AddEmbeddedImage('_guia_skadmin/'.$rs['url'], 'mail_img_'.$rs['id'],$rs['original_name'],'base64',$rs['mime']); } $SQL="SELECT t2.url FROM `mail_boletin_has_nov_contenido` t1 LEFT JOIN nov_img t2 ON (t1.nov_contenido_id=t2.nov_contenido_id) WHERE t1.mail_boletin_id=$bol_id GROUP BY t1.nov_contenido_id"; $r=$db->query($SQL); $n=0; while($rs=mysql_fetch_assoc($r)){ /*AGREGAMOS IMAGENES DE NOVEDADES*/ $size=getimagesize('img/nov/news'.$rs['url']); $mime=$size['mime']; $cad=str_replace('img/nov/news'.$rs['url'],"cid:nov_img_".$n,$cad);//*/ $mail->AddEmbeddedImage('img/nov/news'.$rs['url'], 'nov_img_'.$n,$rs['url'],'base64',$mime); $cad=str_replace('img/nov/cop'.$rs['url'],"cid:nov_cop_img_".$n,$cad);//*/ $mail->AddEmbeddedImage('img/nov/cop'.$rs['url'], 'nov_cop_img_'.$n,'cop'.$rs['url'],'base64',$mime); $n++; } if($n>0){ /*AGREGAMOS IMAGENES DE BANNERS*/ for($i=1;$i<8;$i++){ $SQL="SELECT href,url,cliente FROM banner_banner WHERE banner_position_id=$i ORDER BY id DESC LIMIT 1 "; $r=$db->query($SQL); $rs=mysql_fetch_assoc($r); $rs['url']=str_replace('../','',$rs['url']); $size=@getimagesize($rs['url']); $mime=$size['mime']; $cad=str_replace($rs['url'],"cid:banner_img_".$i,$cad);//*/ $mail->AddEmbeddedImage($rs['url'], 'banner_img_'.$i,"banner_".$i,'base64',$mime); } } if($n>0){ /*AGREGAMOS EL TOP CON EL SUBJECT */ $imagen = imagecreatefromjpeg('_guia_skadmin/templates/img/top_news.jpg'); $negro = ImageColorAllocate($imagen, 0, 0, 0); $subject=html_entity_decode($boletin->subject,ENT_QUOTES,"UTF-8"); $dia=array('','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado','Domingo'); $mes=array('','Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'); $date=$dia[date('N')].' '.date('d').' de '.$mes[date('n')].' '.date('Y'); imagettftext($imagen, 13, 0, 155,162, $negro,"font.ttf",$subject); imagettftext($imagen, 8, 0, 155,175, $negro,"font.ttf",$date); imagejpeg($imagen,'_guia_skadmin/templates/img/top_news_'.$bol_id.'.jpg',100); $cad=str_replace('',"",$cad);//*/ $mime='image/jpeg'; $mail->AddEmbeddedImage('_guia_skadmin/templates/img/top_news_'.$bol_id.'.jpg', 'top_img','top_img_1','base64',$mime); /*FIN EL TOP CON EL SUBJECT */ } $cad=str_replace('"../','"http://www.guiaimpresion.com.ar/',$cad);//*/ $pie='

Este es un e-mail directo, legal, libre de virus y que consideramos de su posible interés. Este mensaje no puede ser considerado SPAM al contener un método para ser removido de la lista de destinatarios, de acuerdo a la Ley N° 25.326 Art. 27 Inc. 3 (Ley de "Habeas Data") de la Republica Argentina


Si usted no desea recibir más boletines de noticias, click aquí

'; $cad=str_replace('',$pie,$cad);//*/ $cad=str_replace('',$id,$cad);//*/ $cad=str_replace('<ID>',$id,$cad);//*/ $cad=str_replace('%3CID%3E',$id,$cad);//*/ //die($cad); ///die($cad); $mail->IsSMTP(); // set mailer to use SMTP $mail->Host =$servers[$n_server]['host']; // specify main and backup server // $mail->Host ='smtp.guiaimpresion.com.ar'; $mail->SMTPAuth = true; // turn on SMTP authentication echo $servers[$n_server]['host'].'
'; $mail->Username = $servers[$n_server]['user']; // SMTP username // $mail->Username="info@smtp.guiaimpresion.com.ar"; $mail->Password = $servers[$n_server]['pass']; // SMTP password // $mail->Password ="bea.zmr.618"; $mail->From = "news@guiaimpresion.com.ar"; $mail->AddReplyTo('news@guiaimpresion.com.ar', 'No responder '.$bol['email']); // $mail->From="info@smtp3.guiaimpresion.com.ar"; $mail->Port=9025; $mail->FromName =utf8_decode("Guía Impresión.");//*/ //$bol['email']='newsletter@guiaimpresion.com.ar'; $resultado = strpos($bol['email'],"guiaimpresion.com.ar"); if($resultado !== FALSE){ $mail->Host = "localhost"; // specify main and backup server $mail->SMTPAuth = false; // turn on SMTP authentication $mail->Username = "newsletter@guiaimpresion.com.ar"; // SMTP username $mail->Password = "Doble-C2011"; // SMTP password//*/ $mail->From = "newsletter@guiaimpresion.com.ar"; //echo 'Utiliza Server Propio.
'; } // $bol['email']='daniel@idel4.com'; // MAIL DE PRUEBA //$bol['email']='dani_skeiros@hotmail.com'; // MAIL DE PRUEBA $mail->AddAddress($bol['email']); //MAIL ORIGINAL // $mail->AddAddress("newsletter@guiaimpresion.com.ar"); $mail->WordWrap = 50; // set word wrap to 50 characters /*$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments $mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name*/ $mail->IsHTML(true); // set email format to HTML $mail->Subject =utf8_decode(html_entity_decode($bol['subjet'],ENT_QUOTES,"UTF-8")); $mail->Body=$cad; //$mail->Body = $cad; $mail->AltBody = "http://www.guiaimpresion.com.ar Guía Impresión."; $error=$mail->Send(); if($error){ echo memory_get_usage()."
"; echo $bol['email']."
"; }else{ echo $mail->ErrorInfo.'
'; //die(); } $SQL="DELETE FROM mail_outbox WHERE mail_suscriptos_id=".$bol['user_id']." AND mail_boletin_id=".$bol['bol']." LIMIT 1"; $rr=$db->query($SQL); $n_server++; } $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $endtime = $mtime; $totaltime = ($endtime - $starttime); echo "This page was created in ".$totaltime." seconds"; ?>