Having a bit of a problem with a simple mail script.. It was working yesterday, but not this morning.. I should point out that it works on all my other remote hosts.. but not the one i need it to.. all hosts are running the same version of php.. and it might not even be a php problem as the resulting error page confuses me...

Code:
<?php
 
$encode = "<?xml version='1.0' encoding='iso-8859-1'?>";
 
if ($action == "submit"):
 
$headers = "MIME-Version: 1.0\r\n"; 
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $name <$email>\r\n";
 
mail(
"recipient email here",
"Enquiry from $name",
"email message here",
$headers);  ///////////// the line reported in the error
 
?>
 
<?=$encode?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>title here</title>
</head>
<body>
thanks message here
</body>
</html>
 
<?php else: ?>
 
<?=$encode?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>title here</title>
<script language="JavaScript" type="text/javascript" src="js/jigsaw.js"></script>
</head>
<body>
form here
</body>
</html>
 
<?php endif; ?>
The form has the action $PHP_SELF.. and the server is using php with register globals on.. and the server administrator says he hasnt changed any settings on the server in the last 48 hours.. which as my form worked yesterday, I find weird!

I removed the mail function from the script and it works fine (obviously with no email being sent)... if I leave the mail function in, I get the error:


Code:
 
The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. Only one top level element is allowed in an XML document. Error processing resource 'http://www.jigsaw7.com/check.php'. Line 2, Position 2 

<b>Warning</b>:  Server Error in <b>C:\Inetpub\jigsaw.com\check.php</b> on line <b>44</b><br />-^
The error line is indicated in the code above, so it is something to do with the email header info Has anyone come across this problem before or does anyone know any idea what the problem is?