Newsletter script

This commit is contained in:
root 2008-05-22 23:01:10 +00:00
parent b2f4b87ca7
commit b233b6e9f2
2 changed files with 69 additions and 0 deletions

19
scripts/koelnemail.txt Normal file
View file

@ -0,0 +1,19 @@
Hallo,
am Freitag, den 02.Mai.2008 1800 Uhr treffen wir uns in Koeln an der
Studentenbibliothek im
Physikalischen Institut zum Keysignen (CAcert und PGP/GPG).
Um 1830 ist es auch schon wieder vorbei.
Bitte kurze Zusage per Mail,
http://www.uni-koeln.de/uni/gebaeude/321.html
Am Eingang des Hoersaal 3 vorbei laeuft man auf den Eingang der
Studentenbibliothek zu. Dann links durch die Glastuere.
http://www.uni-koeln.de/uni/gebaeude/plaene/physik_eg.html
Gruesse,
Jonas Stein
cacert@mail.jonasstein.de

50
scripts/newsletter.php Executable file
View file

@ -0,0 +1,50 @@
#!/usr/bin/php -q
<? /*
LibreSSL - CAcert web application
Copyright (C) 2004-2008 CAcert Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
include_once("../includes/mysql.php");
$lines = "";
$fp = fopen("koelnemail.txt", "r");
while(!feof($fp))
{
$line = trim(fgets($fp, 4096));
$lines .= wordwrap($line, 75, "\n")."\n";
}
fclose($fp);
$query = "select * from `locations` where `id`='417638'";
$loc = mysql_fetch_assoc(mysql_query($query));
$query = "select `users`.* from `users`,`alerts`,`locations` where
((`lat` > ".$loc['lat']."-0.1 and `lat`<".$loc['lat']."+0.1 and `long`>".$loc['long']."-0.1 and `long`<".$loc['long']."+0.1)
)and
(`alerts`.`general`=1 OR `alerts`.`country`=1 OR `alerts`.`regional`=1 OR `alerts`.`radius`=1) AND
`locations`.`id` = `users`.`locid` and `users`.`id`=`alerts`.`memid`";
//$query = "select * from `users` where `email`='pg@futureware.at'";
$res = mysql_query($query);
while($row = mysql_fetch_assoc($res))
{
sendmail($row['email'], "[CAcert.org] Keysigningparty Koeln", $lines, "support@cacert.org", "", "", "CAcert Support", "returns@cacert.org", 1);
echo $row['email']."\n";
}
// OR `users`.`email` like '%.at' OR `users`.`email` like '%.fr' OR `users`.`email` like '%.de' OR
// `users`.`email` like '%.nl' OR `users`.`email` like '%.be' OR `users`.`email` like '%.ch'
// OR `users`.`email` like '%.es' OR `users`.`email` like '%.pt' OR `users`.`email` like '%.ee'
?>