I am using the mail library () in PHP to send mail. This code works very well for me in Gmail and in Outlook. When I place a destination email created in Microsoft Office 365 on a test server it works fine, when I upload it to the Godaddy hosting the script tells me that the email was sent but it never arrives. Thank you in advance
<?php
if($_POST):
$nombre = $_POST['nombre'];
$cargo = $_POST['cargo'];
$empresa = $_POST['empresa'];
$telefono = $_POST['telefono'];
$email = $_POST['email'];
$ciudad = "Cúcuta";
$asunto = "Registro desde el punto de ".$ciudad;
$mensaje = "";
$destino = "[email protected]";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$headers .= "From: ".$ciudad." <". $destino . ">\r\n";
$mensaje = 'Recibiste un nuevo mensaje desde el formulario de <b>'.$ciudad.'</b><br /><br />
Informacion enviada por el usuario de la web:<br />
<b>Nombre</b>: '.$nombre.'<br />
<b>Cargo:</b> '.$cargo.'<br />
<b>Empresa:</b> '.$empresa.'<br />
<b>E-mail:</b> '.$email.'<br />
<b>Telefono:</b> '.$telefono;
// Enviarlo
mail($destino, $asunto, $mensaje, $headers);
echo "El correo fue enviado correctamente.";
?><script>
MostrarGracias(1);
setInterval("RedireccionarInicio()",40000);
</script><?php
else:
echo "No hay datos para procesar";
endif;
?>