All pastes #2065589 Raw Edit

Unnamed

public text v1 · immutable
#2065589 ·published 2011-05-20 11:54 UTC
rendered paste body
<?php


	class Email implements iEmail{

		
		public $reply_to;
		public $subject;
		public $from;
		public $to;
		public $cc;
		public $bcc;
		public $message;
		public $charset		= "iso-8859-15";
		public $site;


		

		public function sendEmail(){
			$this->setHeaders();
                        mail($this->to, $this->site['display_name'] . ' - ' . $this->subject, $this->body, $this->headers,'-f' . $this->from);
                        
			return true;
                        
		}		

		public function setBody($message){
			$this->body	= $message . "
                                          <br><br>
                                          Med vennlig hilsen,<br>
                                          ".$this->site['display_name']."<br><br>

                                          Ikke send meldinger til denne e-postadressen. Svar på denne meldingen leses og besvares ikke.
                                            ";
		}

		public function setHeaders(){
			
			$this->from	=	"ikke_svar@" . $this->site['prefix']. ".no";

			$this->headers	=	'Precedence: bulk' . "\n".
						'MIME-Version: 1.0' . "\n".
						'Content-Type: text/html; charset=' . $this->charset . "\n".
                                                'Content-Transfer-Encoding: 8bit' . "\n".
                                                'Reply-To:'   . $this->reply_to . "\n".
						'From: '. $this->from  . "\n";
						
		}

		public function setBCC($bcc){
			$this->bcc	= $bcc;
		}

		public function setCC($cc){
			$this->cc	= $cc;
		}

		public function setTo($to){
			$this->to	= $to;
		}

		public function setFrom($from){
			$this->from	= $from;
		}

		public function setSubject($subject){
			$this->subject	= $subject;
		}

		public function setSite($site){
			$this->site	= $site;
		}

	}

?>