Location: PHPKode > scripts > XTem xEmail > xtem-xemail/xt_formmail.php
<?

class xEmail{
    var $Data;
    var $Adress;
    var $Title;
	
    function MyClass(){
        /* Constructor: */
        $this->Data=array();
    }
	
	function SetEmailCFG($Adress, $Title)
	{
	
	    $this->Adress = $Adress;
		$this->Title  = $Title;  
	
	}

    function AddValue($Value, $Important)
	{
        if(!$Value && $Important==1) {
		echo "Error. Please fill out all requiered fields!";
		exit;
		}
		else {
		$key = sizeof($this->Data);
		$key = $key + 1;
		$this->Data[$key]=$Value;
		}
    }
	
	function AddValueBox($BoxName, $Value)
	{
	
	    if(!isset($Value)){
		$Value = "";
		}
	    else {
		$Value = $BoxName;
		$key = sizeof($this->Data);
		$key = $key + 1;
		$this->Data[$key]=$Value;
		}
		
	}
	
	function ShowData()
	{

		$key = sizeof($this->Data);
        echo implode(" <br> ", $this->Data);
	
	}
	
	function SendEmail()
	{
	
	    $send_it = mail("$this->Adress","$this->Title",implode(" <br> ", $this->Data),"From: xEmail <hide@address.com>\nContent-Type: text/html");
						
	    if($send_it) { echo "<br>All Right. Email was sent!."; }
		else { echo "<br>Error while connecting to email server!"; }
		
	}
}

?>
Return current item: XTem xEmail