1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77: | <?php
/* Formular anzeigen, wenn Betreff und Newsletter NICHT übergeben wurden */
if(!$nl_betreff OR !$nl_text){
?>
This is the right place to formulate your newsletters.<br><br>
<table class="text" border="0" cellspacing="3" cellpadding="0"><form method="POST" action="<?php echo ($PHP_SELF."?page=admin&action=newsletter&UIN=".$UIN); ?>">
<tr>
<td><img src="./images/absatz_orange.gif" width="4" height="6" alt=""> <span class="text_small text_blue">sender</span><br><input type="text" class="text" name="nl_name" size="37" value="<?php echo $name; ?>"></td>
<td colspan="2"><img src="./images/absatz_orange.gif" width="4" height="6" alt=""> <span class="text_small text_blue">email</span><br><input type="text" class="text" name="nl_email" size="38" value="<?php echo $antwortemail; ?>"></td>
</tr>
<tr>
<td colspan="2"><img src="./images/absatz_orange.gif" width="4" height="6" alt=""> <span class="text_small text_blue">subject</span><br><input type="text" class="text" name="nl_betreff" size="82" value="<?php echo $standard_betreff; ?>"></td>
</tr>
<tr>
<td colspan="2"><img src="./images/absatz_orange.gif" width="4" height="6" alt=""> <span class="text_small text_blue">text</span><br><textarea rows="18" name="nl_text" cols="80"></textarea></td>
</tr>
<tr style="padding-top: 10px;">
<td><input type="submit" class="submit" value=" submit "></td>
<td align="right"><input type="reset" class="submit" value=" reset " style="margin-right: 1px;"></td>
</tr>
</form></table><br>
<?php
} else {
/* Slashes entfernen */
$nl_text = stripslashes($nl_text);
/* Anhang an den Text d. Newsletters hängen */
$nl_text .= $standard_anhang;
$header = "MIME-Version: 1.0\n";
$header .= "Content-type: text/html; charset=iso-8859-1\n";
$header .= "From: " . $name . " <" . $antwortemail . ">\n";
/* E-Mailadressen aus dem Verteiler holen */
/* Für jede E-Mailadresse wird nun die E-Mail abgeschickt */
$max = 40;
$limit = $num*$max;
$domain = "@domain.com";
$result = mysql_query("SELECT EMail " .
" FROM newsletter " .
" WHERE Aktivierung = '1' LIMIT $limit,$max " // so werden nur freigeschaltete Benutzer aus der Datenbank geholt
)or error(__LINE__,__FILE__,"Can not read the addresses!", mysql_error());
while ($row = mysql_fetch_array($result)) {
$i++;
$testmail = "info".$i.$domain;
mail($testmail, $nl_betreff, $nl_text, $header);
}
if($i == $max) {
$num++;
$count = $num*$max;
$text = eregi_replace("\r\n","",htmlspecialchars($nl_text));
sleep(1);
$reload = $PHP_SELF."?page=admin&action=newsletter&UIN=".$UIN."&nl_betreff=".$nl_betreff."&nl_text=".$text."&num=".$num."&count=".$count;
echo "<script language=\"javascript\">self.location=\"".$reload."\"</script>";
}
/* Bestätigung */
$final = $count+$i;
echo ("<span class=\"text_orange\">Result:</span> This newsletter was send out to " . $final . " subscribers."); include ("../footer_content_main.php"); die;
}
?> |