PHP contact form not working in IE?

Hello could someone please help me with this code…
This works a treat in Firefox and Safari but not IE…!

The actual form does what it is supposed to do but the information is not sent and the page does not redirect to a thank you page.

Your help would be much appreciated!

<?php

$txtEmail = trim($_POST['txtEmail']);
$txtSubject = trim($_POST['txtSubject']);
$txtBody = trim($_POST['txtBody']);

function checkEmail($txtEmail) 
{
   if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $txtEmail)) 
   {
      return FALSE;
   }

   list($Username, $Domain) = split("@",$txtEmail);
   
   if(getmxrr($Domain, $MXHost)) 
   {
      return TRUE;
   }
   else 
   {
      if(fsockopen($Domain, 25, $errno, $errstr, 30)) 
      {
         return TRUE; 
      }
      else 
      {
         return FALSE; 
      }
   }
}

if( isset( $_POST['submit'] ) )
{
    $errors = '';
    
    if(checkEmail($txtEmail) == FALSE) 
    {
    
        if( empty($txtEmail) )
        { 
            $errors .= "<br/><strong>You left your email address blank please fill it in...</strong><br/><br/>";
        } else { 
            $errors .= "<strong>Your E-mail address entered is not valid, please go back and try again.<br/><br/></strong>";
        }
    }
    
    if ( empty($txtSubject) ) { $errors .= "<strong>Please put a subject.<br/><br/></strong>"; }
    
    if ( empty($txtBody) ) { $errors .= "<strong>Please write your message.<br/><br/></strong>"; }

    echo $errors;
        
    if ( empty($errors) )
    {
        $sendTo = "me@mydomain.com";
        $subject = $txtSubject;
        $headers = "From: " . $txtEmail;
        $message = $txtBody;
        mail($sendTo, $subject, $message, $headers);
        header("location: http://www.mydomain.com/thankyou.html");        
    }
}

?>