HELP: Email Form not working in PHP5!

Hi,

I’ve been doing a lot of searching on this subject and tried a few suggestions but nothing is helping. I am trying to get my flash mail form to work but the php file I am using wasn’t designed for PHP5 and I am unsure how to change it. I was able to get the register_globals turned on in the php config on the server (as per one suggestion) but the forms still don’t work.

Here is the code I am using-

<?

// Enter your contact email address here
$adminaddress = "[email protected]";

// Enter the address of your website here include http://www.
$siteaddress ="http://www.lior.com.au";

// Enter your company name or site name here
$sitename = "$sitename";

/*******************************************************

No need to change anything below unless you want to add or subtract functions or change the wording of things sent back to the flash file ...

*******************************************************/

// 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);

//Process the form data!
// and send the information collected in the Flash form to Your nominated email address
if ($action != ""):
mail("$adminaddress","$subject",
"A visitor at $sitename has sent the following email.

__________________________________________________________

Name: $fullname
Email: $email
__________________________________________________________
Subject: $subject
__________________________________________________________
Comments: $comments

__________________________________________________________
Logged Info :
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time:  $date","FROM:$adminaddress");

//This sends a confirmation to your visitor
mail("$email","re: $subject",
"Hi $fullname,

We have received your email. This is an automated response. Please do not reply to this email. 
Thank you for your interest in LIOR. 

Sincerely,
$sitename
$siteaddress","FROM:$adminaddress");

//Confirmation is sent back to the Flash form that the process is complete
$sendresult = "Thank you for contacting us. You will receive a confirmation email shortly.";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo "$send_answer";

endif;
?>

If someone could explain how I change this code to work in a PHP5 environment I would be endlessly thankful as it is really urgent.

Many thanks,
Jman