email = $email; $this->timestamp = $timestamp; } public function send($subject, $message, $sender, $replyto) { $headers = "From: " . $sender . "\r\n"; $headers .= "Reply-To: " . $replyto . "\r\n"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\r\n"; // $headers .= "X-Mailer: PHP/" . phpversion(); $headers .= "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7"; return mail($this->email, utf8_decode($subject), utf8_decode($message), $headers); } } class _Mailinglist { public $mailinglist = array(); public $subj_prefix; public $sender; public $replyto; public $footer; public function add($email) { $key = $email->email; if(array_key_exists($key, $this->mailinglist)) return false; $this->mailinglist[$key] = $email; return true; } public function remove($email) { if(array_key_exists($email, $this->mailinglist)) { unset($this->mailinglist[$email]); return true; } return false; } public function postSingle($email, $subject, $message) { $subject = "[".$this->subj_prefix."] " . $subject; $message .= "\n\n".$this->footer; return $email->send($subject, $message, $this->sender, $this->replyto); } public function post($subject, $message) { $sz = sizeof($this->mailinglist); echo "