From 03b4fc309a74688d64d9d05bee5a39c600aa67f2 Mon Sep 17 00:00:00 2001 From: Christian Paminger Date: Fri, 12 Oct 2007 07:03:07 +0000 Subject: [PATCH] --- system/erinnerungsmail.php | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 system/erinnerungsmail.php diff --git a/system/erinnerungsmail.php b/system/erinnerungsmail.php new file mode 100644 index 000000000..fc78b5f4c --- /dev/null +++ b/system/erinnerungsmail.php @@ -0,0 +1,45 @@ +, + * Andreas Oesterreicher and + * Rudolf Hangl . + */ +require_once('../config.inc.php'); + +if(!$conn = pg_pconnect(CONN_STRING)) + die('Fehler beim Connecten zur DB'); + +$qry = "SELECT distinct email FROM public.tbl_studiengang WHERE studiengang_kz!=0 AND email is not null"; + +$headers = "From: vilesci@technikum-wien.at"; +$message = "Dies ist eine automatische eMail!\nBitte überprüfen Sie die Lehrauftragsliste"; + +if($result = pg_query($conn, $qry)) +{ + while($row = pg_fetch_object($result)) + { + $to = "oesi@technikum-wien.at"; + $subject = "Erinnerung $row->email"; + + if(mail($to, $subject, $message, $headers)) + echo "Email an $to versandt\n"; + else + echo "Fehler beim Versenden des Erinnerungsmails an $to\n"; + } +} +?> \ No newline at end of file