00001 <?php
00002
00003 require_once("GenieGate/View.php");
00004
00016 class GenieGate_View_Mail extends GenieGate_View {
00017
00018 var $page;
00019 var $subject;
00020 var $to;
00021 var $hdr = FALSE;
00022
00032 function GenieGate_View_Mail($to,$php){
00033 $this->to($to);
00034 $this->page = $php;
00035 }
00036
00040 function subject($subject = FALSE){
00041 $rv = $this->subject;
00042 if($subject){
00043 $this->subject = $subject;
00044 }
00045 return($rv);
00046 }
00047
00051 function headers($headers = FALSE){
00052 $rv = $this->hdr;
00053 if($headers){
00054 $this->hdr = $headers;
00055 }
00056 return($rv);
00057 }
00058
00064 function page($php = FALSE){
00065 $rv = $this->page;
00066 if($php){
00067 $this->page = $php;
00068 }
00069 return($rv);
00070 }
00071
00079 function to($to = FALSE){
00080 $rv = $this->to;
00081 if($to){
00082
00083
00084
00085
00086
00087
00088 $this->to = preg_replace("/[\t\n\r\s,]/","",$to);
00089 }
00090 return($rv);
00091 }
00092
00097 function display(){
00098 ob_start();
00099 require($this->page);
00100 $data = ob_get_contents();
00101 ob_clean();
00102 ob_end_flush();
00103 if($this->hdr){
00104 return(mail($this->to(),$this->subject(),$data,$this->hdr));
00105 }else{
00106 return(mail($this->to(),$this->subject(),$data));
00107 }
00108 }
00109
00110 }
00111
00112 ?>