"; $errmsg.=""; $errmsg.="$l_noemail"; $errors=1; } if($errors==0) { $sql="select * from ".$tableprefix."_subscriptions where email='$email' and confirmed=1 and category='$newscat'"; if(!$result = mysql_query($sql, $db)) die("Could not connect to the database."); if(!$myrow=mysql_fetch_array($result)) { $errmsg.=""; $errmsg.=""; $errmsg.="$l_noremoveentry"; $errors=1; } } if($errors==1) { include_once('./includes/head.inc'); ?> "; echo ""; echo "$l_back"; echo ""; include_once('./includes/footer.inc'); exit; } $confirmurl=$simpnews_fullurl."subscription.php?$langvar=$act_lang&mode=remove&email=$email&id=".$myrow["unsubscribeid"]; $tmpsql="select * from ".$tableprefix."_texts where textid='usnot' and lang='".$myrow["language"]."'"; if(!$tmpresult = mysql_query($tmpsql, $db)) die("Could not connect to the database."); if($tmprow=mysql_fetch_array($tmpresult)) { $mailmsg=stripslashes($tmprow["text"]); $mailmsg=undo_htmlspecialchars($mailmsg); $mailmsg_html=stripslashes($tmprow["text"]); } else { $mailmsg = $l_unsubscriptionconfirmmail; $mailmsg_html = $l_unsubscriptionconfirmmail_html; } $mailmsg = str_replace("{sitename}",$sitename,$mailmsg); $mailmsg = str_replace("{confirmurl}",$confirmurl,$mailmsg); $mailmsg.= "\n\n---\n$defsignature\n\n\n"; $mailmsg = str_replace("\n",$crlf,$mailmsg); $mailmsg_html = str_replace("{sitename}",$sitename,$mailmsg_html); $mailmsg_html = str_replace("{confirmurl}",$confirmurl,$mailmsg_html); $mailmsg_html.= "\n\n
\n$defsignature\n\n\n"; $mailmsg_html = str_replace("\n","
".$crlf,$mailmsg_html); $mailmsg_html = undo_htmlspecialchars($mailmsg_html); $subject = $l_unsubscriptionconfirmsubject; $subject = str_replace("{sitename}",$sitename,$subject); if($simpnewsmailname) $fromadr="\"$simpnewsmailname\" <$simpnewsmail>"; else $fromadr=$simpnewsmail; $mail = new htmlMimeMail(); $mail->setCrlf($crlf); $mail->setTextWrap($mailmaxlinelength); $mail->setTextCharset($contentcharset); if($myrow["emailtype"]==0) { $mail->setHTMLCharset($contentcharset); $mail->setHTML($mailmsg_html,$mailmsg); } else { $mail->setText($mailmsg); } $mail->setSubject($subject); $mail->setFrom($fromadr); $receiver=array(); array_push($receiver,$myrow["email"]); if(!$insafemode) @set_time_limit($msendlimit); if($use_smtpmail) { $mail->setSMTPParams($smtpserver,$smtpport,NULL,$smtpauth,$smtpuser,$smtppasswd); $sendresult=$mail->send($receiver, "smtp"); } else $sendresult=$mail->send($receiver, "mail"); do_emaillog($sendresult,$myrow["email"],"unsubscribe newsletter"); $redirect=1; include_once('./includes/head.inc'); ?> "; echo ""; echo "$l_unsubscribesent"; if($subredirecturl) $backurl=$subredirecturl; else if(!isset($backurl)) { if(!isset($category)) $category=0; $backurl="news.php?$langvar=$act_lang&layout=$layout&category=$category"; } if($redirectdelay>=0) { echo ""; echo ""; echo "$l_redirected"; } echo ""; echo ""; echo "$l_news"; echo ""; include_once('./includes/footer.inc'); exit; ?>