Ok, aquí indico el código que llega correctamente a hotmail pero al outlook ve el codigo html y también a través de gmail, ono, etc, sólo se ve correctamente en hotmail:
Código PHP:
<HTML>
<HEAD>
<TITLE>Envio Email</TITLE>
<LINK REL="stylesheet" MEDIA="screen" TYPE="text/css" HREF="stils/stilo1.css">
</HEAD>
<?
function comprobar_email($email){
$mail_correcto = 0;
//compruebo unas cosas primeras
if ((strlen($email) >= 6) && (substr_count($email,"@") == 1) && (substr($email,0,1) != "@") && (substr($email,strlen($email)-1,1) != "@")){
if ((!strstr($email,"'")) && (!strstr($email,"\"")) && (!strstr($email,"\\")) && (!strstr($email,"\$")) && (!strstr($email," "))) {
//miro si tiene caracter .
if (substr_count($email,".")>= 1){
//obtengo la terminacion del dominio
$term_dom = substr(strrchr ($email, '.'),1);
//compruebo que la terminación del dominio sea correcta
if (strlen($term_dom)>1 && strlen($term_dom)<5 && (!strstr($term_dom,"@")) ){
//compruebo que lo de antes del dominio sea correcto
$antes_dom = substr($email,0,strlen($email) - strlen($term_dom) - 1);
$caracter_ult = substr($antes_dom,strlen($antes_dom)-1,1);
if ($caracter_ult != "@" && $caracter_ult != "."){
$mail_correcto = 1;
}
}
}
}
}
if ($mail_correcto)
return 1;
else
return 0;
}
if (comprobar_email($email))
{
$destinatario = $emailfriend;
$asunto = "Tu amig@ ". $sender_name. " te recomienda ". $tipo;
$cuerpo = '
<html>
<head>
</body>
</html>';
//para el envío en formato HTML
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $email\r\n";
$headers .= "Reply-To: $email \r\n";
mail($destinatario,$asunto,$cuerpo,$headers)
//aqui finalitza el mail amb format html
?>
<BODY bgcolor="#000000">
<div align="center">
<br>
<font face='verdana' size='-1'color=#FFFFFF>Gracias por Recomendar </font>
</div>
<table border="0" align="center">
<tr>
<td width="100%" align="center" bgcolor="#FFFFFF"><div align="center">
<a href="" onclick='window.close()'><font size="2" face="Arial, Helvetica, sans-serif" color="#666666"><strong>[
Cerrar Ventana ]</strong></font></a>
</div></td>
</tr>
</table>
<?
}
else
{
echo "Algunos de los datos no se han escrito correctamente<br>";
echo "<a href=recomendar_juego.php>Volver a intentarlo</a><br>";
echo "<br><a href=index.php>Volver</a>";
}
?>
</BODY>
</HTML>
Las variables llegan correctamente a este formulario.
Con este código los mails llegan perfectametne a outlook, a gmail y a todos, pero no llegan a hotmail, ni siquiera a la carpeta de spam, simplemente no llegan:
Código PHP:
<HTML>
<HEAD>
<TITLE>Envio Email</TITLE>
<LINK REL="stylesheet" MEDIA="screen" TYPE="text/css" HREF="stils/stilo1.css">
</HEAD>
<?
function comprobar_email($email){
$mail_correcto = 0;
//compruebo unas cosas primeras
if ((strlen($email) >= 6) && (substr_count($email,"@") == 1) && (substr($email,0,1) != "@") && (substr($email,strlen($email)-1,1) != "@")){
if ((!strstr($email,"'")) && (!strstr($email,"\"")) && (!strstr($email,"\\")) && (!strstr($email,"\$")) && (!strstr($email," "))) {
//miro si tiene caracter .
if (substr_count($email,".")>= 1){
//obtengo la terminacion del dominio
$term_dom = substr(strrchr ($email, '.'),1);
//compruebo que la terminación del dominio sea correcta
if (strlen($term_dom)>1 && strlen($term_dom)<5 && (!strstr($term_dom,"@")) ){
//compruebo que lo de antes del dominio sea correcto
$antes_dom = substr($email,0,strlen($email) - strlen($term_dom) - 1);
$caracter_ult = substr($antes_dom,strlen($antes_dom)-1,1);
if ($caracter_ult != "@" && $caracter_ult != "."){
$mail_correcto = 1;
}
}
}
}
}
if ($mail_correcto)
return 1;
else
return 0;
}
if (comprobar_email($email))
{
$destinatario = $emailfriend;
$asunto = "Tu amig@ ". $sender_name. " te recomienda ". $tipo;
$cuerpo = '
<html>
<head>
</body>
</html>';
//para el envío en formato HTML
$destinatario = "$emailfriend";
$responder="$email";
$remite="$email";
$remitente="www.miweb.com";
$cabecera ="Date: ".date("l j F Y, G:i")."\n";
$cabecera .="MIME-Version: 1.0\n";
$cabecera .="From: ".$remitente."<".$remite.">\n";
$cabecera .="Return-path: ". $remite."\n";
$cabecera .="Reply-To: ".$responder."\n";
$cabecera .="X-Mailer: PHP/". phpversion()."\n";
$cabecera .="Content-Type: text/html; charset=\"ISO-8859-1\"\n";
mail($destinatario,$asunto,$cuerpo,$cabecera);
?>
<BODY bgcolor="#000000">
<div align="center">
<br>
<font face='verdana' size='-1'color=#FFFFFF>Gracias por Recomendar </font>
</div>
<table border="0" align="center">
<tr>
<td width="100%" align="center" bgcolor="#FFFFFF"><div align="center">
<a href="" onclick='window.close()'><font size="2" face="Arial, Helvetica, sans-serif" color="#666666"><strong>[
Cerrar Ventana ]</strong></font></a>
</div></td>
</tr>
</table>
<?
}
else
{
echo "Algunos de los datos no se han escrito correctamente<br>";
echo "<a href=recomendar_juego.php>Volver a intentarlo</a><br>";
echo "<br><a href=index.php>Volver</a>";
}
?>
</BODY>
</HTML>
No se exactamente por que está pasando esteo, a ver sime podeis tirar un cable, pero al cuello no....