Newsletter für die Mail-Adresse ".$addr." registriert. Bestätigungs-Mail wird verschickt.

"; $subtoken = md5(uniqid(rand(),1)); $unsubtoken = md5(uniqid(rand(),1)); /* This file is used for storing tokens. One token per line. */ $sub_file = "tmp/subscriber.txt"; $unsub_file = "tmp/unsubscriber.txt"; add_file_entry($sub_file, $subtoken, $addr); add_file_entry($unsub_file, $unsubtoken, $addr); /* Parse out the current working directory for this script. */ $cwd = substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], "/")); /* Report the one-time URL to the user: */ $mailtext = "Hallo!\r\n\r\n"; $mailtext .= "Du wurdest für den achtzig.org-Newsletter eingetragen. "; $mailtext .= "Um Deine Eintragung abzuschließen, besuche bitte folgende Webseite:\r\n"; $mailtext .= "http://".$_SERVER['HTTP_HOST']."/validate.php?q=$subtoken\r\n\r\n"; $mailtext .= "Deine Vorkauer von achtzig.org\r\n\r\n"; $mailtext .= "Um Dich wieder auszutragen, benutze bitte folgenden Link:\r\n"; $mailtext .= "http://".$_SERVER['HTTP_HOST']."/validate.php?q=$unsubtoken\r\n\r\n"; // bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] ) if (!(mail($addr, "achtzig.org: Mitesser-Newsletter", $mailtext, "From: vorkauer@achtzig.org"))) { die("Error mailing to ".$addr); } $_SESSION['time'] = time() ?>