Que tal compañeros, le comento que tengo un formulario el cual manda por correo los comentarios del formulario a mi cliente, el problema es que lo estoy estilizando para que se vea todo mas fancy
Pero cuando hago la prueba no funciona, me envia el correo pero veo el codigo html y no el estilo como lo he definido.
Espero me puedan ayudar, dejo el codigo para ver si me pueden ayudar a ver cual es el error.
Código PHP:
// cambiar por el mail de envio
$email = "[email protected]";
// asunto del email
$subject = "Contacto";
//Cuerpo 2 del mensaje
$mensaje = '<html><head><title>CubeGate</title></head><body style="width:auto;font-family:Arial, Helvetica, sans-serif;">
<div style="width:500px;margin-left:auto;margin-right:auto;">
<div style="width:500px;height:75px;">
<img src="http://cubegatebarriers.com/demo/images/logo.png" width="120" style="float:right;margin-right:25px;" />
</div>
<div style="width:500px;text-align:justify;">
<h3 style="color:#F00;font-size:20px;">Contacto</h3>
<table>
<tr><td>Languaje</td><td>'.$_POST['idioma'].'</td></tr>
<tr><td>Name:</td><td>'.$_POST['nombre'].'</td></tr>
<tr><td>Last Name:</td><td>'.$_POST['apellido'].'</td></tr>
<tr><td>Telephone:</td><td>'.$_POST['telefono'].'</td></tr>
<tr><td>E-Mail:</td><td>'.$_POST['mail'].'</td></tr>
<tr><td colspan="2"><hr /></td></tr>
<tr><td colspan="2">Comment:</td></tr>
<tr><td colspan="2">'.$_POST['texto'].'</td></tr>
<tr><td></td></tr>
</table>
</div><br/><br />
<div style="background:#871002;width:500px;height:15px"></div>
<div style="background:#e10613;width:500px;height:15px"></div>
</div>
</body></html>';
// headers del email
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers = "From: ".$_POST['mail']."\r\n";
// Enviamos el mensaje
if (mail($email, $subject, $mensaje, $headers)) {
echo = "Envio Correcto";
} else {
$aviso = "Error de envío.";
}