| 1 |
lars |
1 |
<?
|
|
|
2 |
$self=basename($PHP_SELF);
|
|
|
3 |
$DB="verteiler";
|
|
|
4 |
require_once "../Online-Shop/connect2.php";
|
|
|
5 |
|
|
|
6 |
if (isset($user_rechte[mail_verteiler][versenden][html]))
|
|
|
7 |
{
|
|
|
8 |
header("Location: mailVerteilerSelect.php");
|
|
|
9 |
}
|
|
|
10 |
|
|
|
11 |
if ($action)
|
|
|
12 |
{
|
|
|
13 |
$query="SELECT * FROM Verteiler where ID = $Verteiler_NR";
|
|
|
14 |
$result_Verteiler = mysql_query ($query) or die (mysql_errno().": ".mysql_error()."<hr>$query<hr>");
|
|
|
15 |
$Verteiler=mysql_fetch_array($result_Verteiler);
|
|
|
16 |
|
|
|
17 |
$headers["From"]="From: $Verteiler[Absender]";
|
|
|
18 |
$headers=implode("\n",$headers);
|
|
|
19 |
|
|
|
20 |
// Mailadressen filtern und formatieren
|
|
|
21 |
preg_match_all("/[A-Za-z0-9-_.+]+\@[A-Za-z0-9-_.+]+\.[A-Za-z]+/", $To, $matches);
|
|
|
22 |
$matches=$matches[0];
|
|
|
23 |
|
|
|
24 |
foreach($matches as $mailadresse)
|
|
|
25 |
{
|
|
|
26 |
$logout_link = $web_rechte[mail_verteiler][verteiler][logout_link]."?m=".$mailadresse."&v=".$Verteiler[ID];
|
|
|
27 |
|
|
|
28 |
$text = array(
|
|
|
29 |
$Verteiler[Begruessung],
|
|
|
30 |
$message,
|
|
|
31 |
$Verteiler[Schlusstext],
|
|
|
32 |
"\n".$logout_link,
|
|
|
33 |
);
|
|
|
34 |
$text = implode("\n",$text);
|
|
|
35 |
|
|
|
36 |
mail($mailadresse, $Verteiler[Betreff], $text, $headers);
|
|
|
37 |
}
|
|
|
38 |
header("Location: mailsent.php?count=".count($matches));
|
|
|
39 |
}
|
|
|
40 |
|
|
|
41 |
$Verteiler=array();
|
|
|
42 |
$result = mysql_query ("SELECT * FROM Verteiler order by name") or die (mysql_errno().": ".mysql_error());
|
|
|
43 |
while($zeile=mysql_fetch_array($result))
|
|
|
44 |
{
|
|
|
45 |
$Verteiler[$zeile[ID]]=$zeile;
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
if (!$Verteiler_NR)
|
|
|
49 |
{
|
|
|
50 |
$Verteiler_NR = array_keys($Verteiler);
|
|
|
51 |
$Verteiler_NR = $Verteiler_NR[0];
|
|
|
52 |
}
|
|
|
53 |
?>
|
|
|
54 |
<html>
|
|
|
55 |
<head>
|
|
|
56 |
<title>Mail versenden</title>
|
|
|
57 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
58 |
<meta name="author" content="Webagentur Niewerth - www.weban.de">
|
|
|
59 |
<meta name="revisit-after" content="30 days">
|
|
|
60 |
<meta name="language" content="deutsch, de">
|
|
|
61 |
<meta name="distribution" content="global">
|
|
|
62 |
<meta name="robots" content="all">
|
|
|
63 |
<link rel=stylesheet type="text/css" href="../buttons.css">
|
|
|
64 |
<style type="text/css">
|
|
|
65 |
<!--
|
|
|
66 |
a { color: #<? echo $webs[font_color_rechts] ?>}
|
|
|
67 |
-->
|
|
|
68 |
</style>
|
|
|
69 |
</head>
|
|
|
70 |
|
|
|
71 |
<body bgcolor="#<? echo $webs[bgcolor_seite] ?>" leftmargin="20" topmargin="10" marginwidth="20" marginheight="10" text="#<? echo $webs[font_color_rechts] ?>">
|
|
|
72 |
<form method="post" action="#" enctype="multipart/form-data">
|
|
|
73 |
<table width="600" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#FFFFFF" bordercolordark="#999999">
|
|
|
74 |
<tr>
|
|
|
75 |
<td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" colspan="2">Verteiler
|
|
|
76 |
senden: <input type="hidden" name="Verteiler_NR" value="<?=$_REQUEST[Verteiler_NR];?>"></td>
|
|
|
77 |
</tr>
|
|
|
78 |
<tr>
|
|
|
79 |
<td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" width="20%" valign="top">Absender:</td>
|
|
|
80 |
<td bgcolor="#<? echo $webs[bgcolor_rechts] ?>">
|
|
|
81 |
<? echo nl2br($Verteiler[$Verteiler_NR][Absender]) ?>
|
|
|
82 |
</td>
|
|
|
83 |
</tr>
|
|
|
84 |
<tr>
|
|
|
85 |
<td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" width="20%" valign="top">An:</td>
|
|
|
86 |
<td bgcolor="#<? echo $webs[bgcolor_rechts] ?>">
|
|
|
87 |
<?
|
|
|
88 |
$to=array();
|
|
|
89 |
$query="
|
|
|
90 |
SELECT DISTINCT
|
|
|
91 |
Logins.E_Mail,
|
|
|
92 |
MD5(Logins.E_Mail) as MD5
|
|
|
93 |
FROM
|
|
|
94 |
Logins,
|
|
|
95 |
Logins_to_Verteiler
|
|
|
96 |
WHERE
|
|
|
97 |
Logins.ID = Logins_to_Verteiler.Logins
|
|
|
98 |
AND
|
|
|
99 |
Logins_to_Verteiler.Verteiler = '".$_REQUEST[Verteiler_NR]."'
|
|
|
100 |
ORDER BY
|
|
|
101 |
ID
|
|
|
102 |
";
|
|
|
103 |
$result = mysql_query ($query) or die (mysql_errno().": ".mysql_error()."<hr>$query<hr>");
|
|
|
104 |
$count = mysql_num_rows($result);
|
|
|
105 |
while ($zeile=mysql_fetch_assoc($result))
|
|
|
106 |
{
|
|
|
107 |
if (preg_match("/^[A-Za-z0-9-_.+]+\@[A-Za-z0-9-_.+]+\.[A-Za-z]+$/", $zeile[E_Mail]) > 0)
|
|
|
108 |
{
|
|
|
109 |
$to[$zeile[MD5]]=$zeile[E_Mail];
|
|
|
110 |
}
|
|
|
111 |
}
|
|
|
112 |
?>
|
|
|
113 |
<textarea name="To" cols="55" rows="10"><? echo implode(",\n",$to) ?></textarea>
|
|
|
114 |
<br>
|
|
|
115 |
Anzahl der ausgelesenen Empfänger:
|
|
|
116 |
<?=count($to);?> </td>
|
|
|
117 |
</tr>
|
|
|
118 |
<tr>
|
|
|
119 |
<td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" width="20%" valign="top">Betreff:</td>
|
|
|
120 |
<td bgcolor="#<? echo $webs[bgcolor_rechts] ?>">
|
|
|
121 |
<? echo nl2br($Verteiler[$Verteiler_NR][Betreff]) ?>
|
|
|
122 |
</td>
|
|
|
123 |
</tr>
|
|
|
124 |
<tr>
|
|
|
125 |
<td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" width="20%" valign="top">Begrüssung:</td>
|
|
|
126 |
<td bgcolor="#<? echo $webs[bgcolor_rechts] ?>">
|
|
|
127 |
<? echo nl2br($Verteiler[$Verteiler_NR][Begruessung]) ?>
|
|
|
128 |
</td>
|
|
|
129 |
</tr>
|
|
|
130 |
<tr>
|
|
|
131 |
<td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" width="20%" valign="top">Text:</td>
|
|
|
132 |
<td bgcolor="#<? echo $webs[bgcolor_rechts] ?>">
|
|
|
133 |
<textarea name="message" cols="100" rows="10" wrap="OFF"></textarea>
|
|
|
134 |
</td>
|
|
|
135 |
</tr>
|
|
|
136 |
<tr>
|
|
|
137 |
<td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" width="20%" valign="top">Schlusstext:</td>
|
|
|
138 |
<td bgcolor="#<? echo $webs[bgcolor_rechts] ?>">
|
|
|
139 |
<? echo nl2br($Verteiler[$Verteiler_NR][Schlusstext]) ?>
|
|
|
140 |
</td>
|
|
|
141 |
</tr>
|
|
|
142 |
<tr align="right">
|
|
|
143 |
<td bgcolor="#<? echo $webs[bgcolor_links] ?>" class="headline" colspan="2">
|
|
|
144 |
<input type="submit" name="action" value="Abschicken">
|
|
|
145 |
<input type="reset" value="Zurücksetzen">
|
|
|
146 |
</td>
|
|
|
147 |
</tr>
|
|
|
148 |
</table>
|
|
|
149 |
</form>
|
|
|
150 |
</body>
|
|
|
151 |
</html>
|