Hier noch der Source des Newsletter Scripts:
PHP-Code:
<?
$html = "";
$pos = "";
$postxt = "";
if(!empty($newsletter)) {
$db->query("UPDATE newsletter SET SendTime=NOW() WHERE ID=".$newsletter);
$html .= "<html>";
$html .= "<head>";
$html .= "<title>Heeb AG Group Newsletter</title>";
$html .= "<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">";
$html .= "<link href="http://srvweb/style.css" rel="stylesheet" type="text/css">";
$html .= "<body leftmargin="1" topmargin="1">";
$html .= "<table width="100%" border="0">";
$html .= "<tr>";
$html .= "<td colspan="2"><img src="http://srvweb/images/header.jpg" width="643" height="117" usemap="#Map" border="0"></td>";
$html .= "<a name="top_of_mail"></a>";
$html .= "<td rowspan="4" width="100%"> </td>";
$html .= "</tr>";
$html .= "<tr>";
$html .= "<td width="325" rowspan="2" valign="top"><p>Liebe/r [VORNAME] [NACHNAME]</p>";
$html .= "<p>[KOPFTEXT]</p></td>";
$html .= "<td width="325" height="21" valign="top"><font size="2"><b>[HEADLINE]</b><br><hr><br></font></td>";
$html .= "</tr>";
$html .= "<tr>";
$html .= "<td valign="top"><table width="100%" bordercolor="#000000" border="1">";
$html .= "<tr>";
$html .= "<td valign="top" bordercolor="#FFFFFF" bgcolor="#E0E0E0">";
$html .= "<table width="100%" border="0">";
$html .= "<tr>";
$html .= "<td>Inhaltsverzeichnis</td>";
$html .= "<td align="right">".date("d.m.Y")."</td></tr></table>";
$html .= "</td>";
$html .= "</tr>";
$html .= "<tr>";
$html .= "<td valign="top" bordercolor="#FFFFFF"> <p>[POSITIONEN]</p> </td>";
$html .= "</tr>";
$html .= "</table></td>";
$html .= "</tr>";
$db->query("select * from newsletterpos where NewsletterID = ".$newsletter);
while($db->next_record()) {
$html .= "<tr>";
$html .= "<td colspan="2" valign="top"><hr>";
$html .= "<a name="Section_".$db->Record['ID'].""></a>";
$html .= "<table width="100%" border="0">";
$html .= "<tr bgcolor="#E0E0E0">";
$html .= "<td colspan="2"><a href="".$db->Record['Link']."" target="_blank"><font color="#000000"><b>".$db->Record['Title']."</b></font></a></td>";
$html .= "</tr>";
$html .= "<tr>";
$html .= "<td valign="top" width="100%">".$db->Record['Shorttext'];
$html .= "</td>";
$html .= "<td width="10"><a href="".$db->Record['Link']."" target="_blank"><img align="right"src="http://srvweb/images/upload/".$db->Record['PictureID']."_1.jpg" border="0" alt=""></a></td>";
$html .= "</tr>";
$html .= "<tr>";
$html .= "<td>";
$html .= "<br><a href="".$db->Record['Link']."" target="_blank">» ".$db->Record['LinkText']."</a>";
$html .= "</td>";
$html .= "<td>";
$html .= "<br><A href="#top_of_mail"><img align="right"src="http://srvweb/images/top.gif" border="0" alt=""></a>";
$html .= "</td>";
$html .= "</tr>";
$html .= "</table>";
}
$html .= "<br><hr>";
$html .= "<table width="100%" border="0">";
$html .= "<tr>";
$html .= "<td bgcolor="#E0E0E0" valign="top">";
$html .= "<table width="100%" border="0">";
$html .= "<tr>";
$html .= "<td valign="top"> Für Links auf externe Seiten und deren Inhalte kann die HEEB AG group keine Haftung übernehmen. </td>";
$html .= "<td align="right"><img src="http://srvweb/images/heeb_logonews.jpg" border="0"></td></tr></table>";
$html .= "</td>";
$html .= "</tr>";
$html .= "<tr bgcolor="#CDCDCD">";
$html .= "<td colspan="2"> <a href="http://srvweb" target="_blank"><font color="#000000">Home</font></a>";
$html .= " | <a href="http://srvweb/index.php?PageID=49&action=edit" target="_blank"><font color="#000000">Profil ändern</font></a>";
$html .= " | <a href="http://srvweb/index.php?PageID=214" target="_blank"><font color="#000000">Abmelden</font></a>";
$html .= " | <a href="http://srvweb/index.php?PageID=118" target="_blank"><font color="#000000">Kontakt</font></a></td>";
$html .= "</tr>";
$html .= "</table>";
$html .= "<br>© ".date("Y")." HEEB AG group, Alle Rechte vorbehalten<br><br>";
$html .= "</td>";
$html .= "</tr>";
$html .= "</table>";
$html .= "<map name="Map">";
$html .= "<area shape="rect" coords="582,96,639,111" href="http://srvweb/index.php?PageID=118" target="_blank">";
$html .= "<area shape="rect" coords="475,94,547,111" href="http://srvweb/index.php?PageID=214" target="_blank">";
$html .= "<area shape="rect" coords="349,95,442,111" href="http://srvweb/index.php?PageID=49&action=edit" target="_blank">";
$html .= "<area shape="rect" coords="271,95,313,111" href="http://srvweb" target="_blank">";
$html .= "</map>";
$html .= "</body>";
$html .= "</html>";
$db->query("select * from newsletter where ID = ".$newsletter);
$db->next_record();
$groupID = $db->Record['GroupID'];
$html = str_replace("[KOPFTEXT]",$db->Record['Text'],$html);
$html = str_replace("[HEADLINE]",$db->Record['Headline'],$html);
$subject = $db->Record['Title'];
$db->query("select * from newsletterpos where NewsletterID = ".$newsletter);
while($db->next_record()) {
$pos .= "<a href="#Section_".$db->Record['ID']."">".$db->Record['Title']."</a><br><br>";
}
$html = str_replace("[POSITIONEN]",$pos,$html);
if($groupID == 0) {
$db->query("select FirstName, LastName, EMail from users where newsletter = 1");
} else {
$db->query("select u.FirstName as FirstName, u.LastName as LastName, u.EMail as EMail from user_groups g left join users u on u.ID = g.UserID where u.newsletter = 1 and g.GroupID = ".$groupID);
}
while($db->next_record()) {
$text = str_replace("[VORNAME]",$db->Record['FirstName'],$html);
$text = str_replace("[NACHNAME]",$db->Record['LastName'],$text);
/* Um eine HTML-Mail zu senden, können Sie den den "Content-type"-Header.
setzen */
$headers = "MIME-Version: 1.0n";
$headers .= "Content-type: text/htmln";
/* zusätzliche Header */
$headers .= "To: ".$db->Record['LastName']." ".$db->Record['FirstName']." <".$db->Record['EMail'].">n";
$headers .= "From: Heeb AG Group <newsletter@heeb.com>n";
//mail($db->Record[EMail], $subject, $text, $headers);
mail($db->Record['EMail'], $subject, $text, $headers);
}
}
// Den Teil mit dem TextNewsletter lass ich jetzt weg
?>