Ringrazio in anticipo chiunque voglia aiutarmi caffe pagato!
Ho uno script per inviare newsletter, ho controllato e ricontrollato,
le email partono correttamente ma non si leggono su outlook express...
che è il browser principale di quasi tutti gli iscritti al servizio.
Il resto è ok. 8registrazione e via di seguito)
vi allego qui l aparte di script incriminata... la conoscenza delle variabili non è fondamentale per capire il senso del tutto:
// SEND ARTICLE BY E-MAIL SUBSCRIPTIONS
function send_article($articleID){
$qwry = "SELECT * FROM ".db('prefix')."articles WHERE id = $articleID"; $qr = mysql_query($qwry);
while ($rs = mysql_fetch_array($qr)) {
$title = $rs['title']; $sef = $rs['seftitle']; $cat = $rs['category']; $text = stripslashes($rs['text']);
$ptext = substr($text,0,strpos($text,'[break]'));}
$name = $cat == 0 ? l('home_sef') : retrieve('seftitle','categories','id', $cat); $url = sprintf('%s/%s/',$name,$sef);
$subject = l('receive_newsletter').s('website_title'); $eol = "\r\n";
$replyname = s('website_title'); $replyemail = s('website_email');
$query = "SELECT * FROM ".db('prefix')."newsletter";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
$id = $r['id']; $email = $r['email'];
$mime_boundary=md5(time());
$header = "From: ".$replyname." <".$replyemail.">".$eol;
$header .= "Reply-To: ".$replyname." <".$replyemail.">".$eol;
$header .= "Return-Path: ".$replyname." <".$replyemail.">\r\n";
$header .= "Message-ID: <".time().".".$replyemail.">\r\nX-Mailer: PHP v".phpversion().$eol;
$header .= "MIME-Version: 1.0".$eol;
$header .= "Content-type: text/plain; charset=".s('charset')."\n";
$header .= "Content-Type: multipart/alternative;\r\n boundary=\"----=_Part_".$mime_boundary."\"".$eol.$eol;
$msg = "------=_Part_".$mime_boundary.$eol;
# Text Version
$msg .= "Content-Type: text/plain; charset=".s('charset').$eol;
$msg .= "Content-Transfer-Encoding: quoted-printable".$eol.$eol;
$msg .= "Messaggio in formato testo, il tuo browser non supporta HTML format".$eol;
$msg = "------=_Part_".$mime_boundary.$eol;
# HTML Version
$msg .= "Content-Type: text/html; charset=".s('charset').$eol;
$msg .= "Content-Transfer-Encoding: quoted-printable".$eol.$eol;
// $msg = "------=_Part_".$mime_boundary.$eol
$msg .= "<html>\n";
$msg .= "<body style =\"background-color: #F2F2F2; font-family: arial, sans-serif; font-size: .8em; color: #808080; padding: 0; margin: 0\">";
$txt = sprintf('id=%s&email=%s', "=".$id, "=".md5($email));
$unsubscribe = sprintf('id=%s&email=%s', $id, md5($email));
# logo uilpa509.it
$msg .="<font size=\"130%\">Uilpa509.it Newsletter</font>";
// $msg .= "<h3><a href=\"".sprintf(db('website').'%s',$url)."\">".$title."</a></h3>";
$msg .= "<h3><a href=".ht.sprintf(db('website').'%s',$url).">".$title."</a></h3>";
$msg .= $ptext;
$msg .= "<br><br>";
# prove sul link all'articolo
# original line $msg .= sprintf(db('website').'%s', $url)."<br /><br />";
$msg .= "<h2><a href= ".h.sprintf(db('website').'%s', $url).">Leggi tutto l'articolo...</a></h2>";
$msg .= "<hr>";
$msg .= "<h6>".l('newsletter_info1')." ".$email."<br /><br />".l('newsletter_info2')."<br /><br />";
$msg .= sprintf(db('website').'remove_newsletter&%s',$txt)."<br /><br />";
$msg .= l('newsletter_info3')."<br /><br />".l('newsletter_info4')."</h6>";
$msg .= "</body>\n";
$msg .= "</html>\n";
//close the html/plain text alternate portion
$msg .= "------=_Part_".$mime_boundary."--".$eol.$eol;
# SEND THE EMAIL
mail( $email, $subject, $msg, $header );}
}
Ho uno script per inviare newsletter, ho controllato e ricontrollato,
le email partono correttamente ma non si leggono su outlook express...
che è il browser principale di quasi tutti gli iscritti al servizio.
Il resto è ok. 8registrazione e via di seguito)
vi allego qui l aparte di script incriminata... la conoscenza delle variabili non è fondamentale per capire il senso del tutto:
// SEND ARTICLE BY E-MAIL SUBSCRIPTIONS
function send_article($articleID){
$qwry = "SELECT * FROM ".db('prefix')."articles WHERE id = $articleID"; $qr = mysql_query($qwry);
while ($rs = mysql_fetch_array($qr)) {
$title = $rs['title']; $sef = $rs['seftitle']; $cat = $rs['category']; $text = stripslashes($rs['text']);
$ptext = substr($text,0,strpos($text,'[break]'));}
$name = $cat == 0 ? l('home_sef') : retrieve('seftitle','categories','id', $cat); $url = sprintf('%s/%s/',$name,$sef);
$subject = l('receive_newsletter').s('website_title'); $eol = "\r\n";
$replyname = s('website_title'); $replyemail = s('website_email');
$query = "SELECT * FROM ".db('prefix')."newsletter";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
$id = $r['id']; $email = $r['email'];
$mime_boundary=md5(time());
$header = "From: ".$replyname." <".$replyemail.">".$eol;
$header .= "Reply-To: ".$replyname." <".$replyemail.">".$eol;
$header .= "Return-Path: ".$replyname." <".$replyemail.">\r\n";
$header .= "Message-ID: <".time().".".$replyemail.">\r\nX-Mailer: PHP v".phpversion().$eol;
$header .= "MIME-Version: 1.0".$eol;
$header .= "Content-type: text/plain; charset=".s('charset')."\n";
$header .= "Content-Type: multipart/alternative;\r\n boundary=\"----=_Part_".$mime_boundary."\"".$eol.$eol;
$msg = "------=_Part_".$mime_boundary.$eol;
# Text Version
$msg .= "Content-Type: text/plain; charset=".s('charset').$eol;
$msg .= "Content-Transfer-Encoding: quoted-printable".$eol.$eol;
$msg .= "Messaggio in formato testo, il tuo browser non supporta HTML format".$eol;
$msg = "------=_Part_".$mime_boundary.$eol;
# HTML Version
$msg .= "Content-Type: text/html; charset=".s('charset').$eol;
$msg .= "Content-Transfer-Encoding: quoted-printable".$eol.$eol;
// $msg = "------=_Part_".$mime_boundary.$eol
$msg .= "<html>\n";
$msg .= "<body style =\"background-color: #F2F2F2; font-family: arial, sans-serif; font-size: .8em; color: #808080; padding: 0; margin: 0\">";
$txt = sprintf('id=%s&email=%s', "=".$id, "=".md5($email));
$unsubscribe = sprintf('id=%s&email=%s', $id, md5($email));
# logo uilpa509.it
$msg .="<font size=\"130%\">Uilpa509.it Newsletter</font>";
// $msg .= "<h3><a href=\"".sprintf(db('website').'%s',$url)."\">".$title."</a></h3>";
$msg .= "<h3><a href=".ht.sprintf(db('website').'%s',$url).">".$title."</a></h3>";
$msg .= $ptext;
$msg .= "<br><br>";
# prove sul link all'articolo
# original line $msg .= sprintf(db('website').'%s', $url)."<br /><br />";
$msg .= "<h2><a href= ".h.sprintf(db('website').'%s', $url).">Leggi tutto l'articolo...</a></h2>";
$msg .= "<hr>";
$msg .= "<h6>".l('newsletter_info1')." ".$email."<br /><br />".l('newsletter_info2')."<br /><br />";
$msg .= sprintf(db('website').'remove_newsletter&%s',$txt)."<br /><br />";
$msg .= l('newsletter_info3')."<br /><br />".l('newsletter_info4')."</h6>";
$msg .= "</body>\n";
$msg .= "</html>\n";
//close the html/plain text alternate portion
$msg .= "------=_Part_".$mime_boundary."--".$eol.$eol;
# SEND THE EMAIL
mail( $email, $subject, $msg, $header );}
}