<?  

$adminaddress = "pps.maniam@gmail.com"; 
//adminaddress = "nantha@motionwavedesigns.com"; 
$siteaddress ="http://www.psmassociates.com.my/"; 
$sitename = "PSM Associates"; 

//No need to change anything below ... 
// Gets the date and time from your server
$date = date("m/d/Y H:i:s");

// Gets the IP Address
if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);

// Gets the POST Headers - the Flash variables
$action = $HTTP_POST_VARS['action'] ;
$name = $HTTP_POST_VARS['name'] ;
$email = $HTTP_POST_VARS['email'] ;
$phone = $HTTP_POST_VARS['phone'] ;
$query = $HTTP_POST_VARS['query'] ;


//Process the form data!
// and send the information collected in the Flash form to Your nominated email address

if ($action == "send") {
	//
	mail ("$adminaddress","PSM Associates visitor's comment",
	"A visitor at $sitename has left the following query\n
	Name : $name
	Email: $email
	Phone: $phone
	
	The visitor's query:
	------------------------------
	Query: $query
	------------------------------
	Date/Time:  $date","FROM:$adminaddress" ) ; 
	
	
	
	//Confirmation is sent back to the Flash form that the process is complete
	$sendresult = "Thank You. Your message sent.";
	$send_answer = "answer=";
	$send_answer .= rawurlencode($sendresult);
	echo $send_answer;
	
	//This sends a confirmation to your visitor
	mail ("$email","Thank You for visiting $sitename", 
	"Hi $name,\n
	Thank you for your interest in $sitename!\n
	Cheers,
	$sitename
	$siteaddress","FROM:$adminaddress") ;
} //


?>

