function sendTheMail () { // Sends the mail. // Requires the recipient, message and headers to be set. #debug(array($this->recipient,$this->subject,$this->message,$this->headers)); if (trim($this->recipient) && trim($this->message)) { // && trim($this->headers) $returnPath = (strlen($this->returnPath)>0)?"-f".$this->returnPath:''; mail( $this->recipient, $this->subject, $this->message, $this->headers, $returnPath ); // Sending copy: if ($this->recipient_copy) { mail( $this->recipient_copy, $this->subject, $this->message, $this->headers, $returnPath ); } // Auto response if ($this->auto_respond_msg) { $theParts = explode("/",$this->auto_respond_msg,2); $theParts[1] = str_replace("/",chr(10),$theParts[1]); mail( $this->from_email, $theParts[0], $theParts[1], "From: ".$this->recipient, $returnPath ); } return true; } else {return false;} }