Como t dijieron anteriormente, si tnes HTML antes, el header no t va a funcionar....podrias redirigir al usuario con un JavaScript....asi:
Código PHP:
<?php
$mail='[email protected]';
$nombre = $_POST['nombre'];
$telefono = $_POST['telefono'];
$email = $_POST['email'];
$mensaje = $_POST['mensaje'];
$thank="gracias.html";
$message = "
nombre:".$nombre."
telefono:".$telefono."
email:".$email."
mensaje:".$mensaje."";
if (mail($mail,"Formulario de Consulta",$message))
{
?>
<script type="text/javascript">
window.location="../DirectorioX/<?php echo $thank; ?>";
</script>
<?php
}
?>
Saludos...