<?php

include "libmail.php";

$Name="Admin";

$message =  "Name : $Name   \n";
$message = $message.  "Company : SN  \n";
$message = $message.  "Address : 12  \n";
$message = $message.  "Telephone : 022222222 \n";
$message = $message.  "Fax : -\n";
$message = $message.  " E-mail: siamnova@thongbai.com \n";
$message = $message.  "Comment : ....... \n";
$message = $message."\n======\nService by http://www.thongbai.com ";


$m = new Mail(); // create the mail

$m->From( "siamnova@thongbai.com" );
$m->To( "test@thongbai.com" );
$m->Subject( "Contact" );
$m->Body( "$message" );
$m->Cc( "siamnova@thongbai.com");
$m->Priority(1);

// attach a file of type image/gif to be displayed in the message if possible 
if($Upload_file1_name!="")
{

	   if($Upload_file1_size>$MAX_FILE_SIZE)
	      {
		         print "Your file is too large. Please use your Back button.";
		          return 0;
		  }
		  $FDir="tmp";
		 //file_delete("$FDir/*.*");
		 $txt="$FDir/$Upload_file1_name"; 
	      if (@copy ($Upload_file1,$txt))
               {
                    //echo "Thank you \n";
                 }else    {
                                    echo "failed to copy $txt...\n";
			                         return 1;		 
                                     exit;
                                }	  
		  
		  $mimetype="application/x-unknown-content-type";
       $m->Attach($txt,$mimetype, "attachment" );

}

$m->Send(); // send the mail 

//echo "Mail was sent:"
//echo $m->Get(); // show the mail source


?>

    <?php  
   function file_delete($file)  
   {  
       chmod($file, 0777);  
       if(unlink($file))  
       {  
           return true;  
       }else{  
           return false;  
       }  
   }  
?> 


<title>#### SPM #### Thank You </title>
