X-Git-Url: https://git.p6c8.net/form-email.git/blobdiff_plain/c11340f2adaf46b0294d96a9a18740dfcdbd1e24..7c32bd0e4e2a03f33abbd4168bb8358513312fde:/form-email/mailer.php?ds=inline diff --git a/form-email/mailer.php b/form-email/mailer.php index 5ad8407..ba4d410 100644 --- a/form-email/mailer.php +++ b/form-email/mailer.php @@ -7,7 +7,7 @@ # geschrieben wurde. # # Autor: Patrick Canterino -# Letzte Aenderung: 02.01.2012 +# Letzte Aenderung: 09.01.2012 # # Copyright (C) 2002-2012 Patrick Canterino # @@ -241,8 +241,10 @@ $subject = preg_replace("/\015\012|\012|\015/",' ',$subject); # Uhrzeit formatieren +$timestamp = time(); + date_default_timezone_set($timezone); -$time = strftime($timeformat); +$time = strftime($timeformat,$timestamp); # Header der Mail @@ -348,6 +350,62 @@ for($x=0;$x 0) { + $dp = opendir($store_mails_dir); + + while($stored_mail_file = readdir($dp)) { + if($stored_mail_file != '.' && $stored_mail_file != '..' && substr($stored_mail_file,0,strlen($store_mails_prefix)) == $store_mails_prefix) { + $stored_mail_files[$store_mails_dir.'/'.$stored_mail_file] = filemtime($store_mails_dir.'/'.$stored_mail_file); + } + } + + closedir($dp); + + arsort($stored_mail_files); + + #print sizeof($stored_mail_files); + + #print_r($stored_mail_files); + + $x = 0; + + foreach(array_keys($stored_mail_files) as $stored_mail_filename) { + $x++; + + if($x > $store_mails_max) { + unlink($stored_mail_filename); + } + } + } +} + if($captcha_enable) session_destroy(); # Mail wurde erfolgreich versendet, also wird die Dankesseite angezeigt