
18/02/2016, 12:18
|
| | Fecha de Ingreso: febrero-2016
Mensajes: 9
Antigüedad: 9 años Puntos: 0 | |
Respuesta: Formulario PHP no envía Código HTML: <div class="col-sm-6 col-md-7">
<h3>Déjanos un mensaje</h3>
<form role="form" method="post" enctype="multipart/form-data" action="[COLOR="Red"]http://www.xxxxxxxxxx.es/contacto-form.php[/COLOR]">
<div class="form-group">
<label class="letra16" for="nombre">Tu nombre</label>
<input type="text" name="nombre" class="form-control input-lg cambio" id="nombre" required>
</div>
<div class="form-group">
<label class="letra16" for="email">Tu email</label>
<input type="email" name="email" class="form-control input-lg cambio" id="email" required>
</div>
<div class="form-group">
<label class="letra16" for="mensaje">Mensaje</label>
<textarea id="mensaje" class="form-control input-lg cambio" rows="6"></textarea>
</div>
<button class="btn btn-info boton_enviar pull-right cambio" type="submit">Enviar</button>
</form>
</div> Código PHP:
<?php
if($_POST["email"]) {
$to="[COLOR="Red"][email protected][/COLOR]";
$subject = "Comentario desde la Web";
$body = '<p style="font-family: Arial, Helvetica, sans-serif; color:#382416; font-size:30px; width: 730px; margin: 10px 25px 0px 25px; padding:0px;">xxxxxxxxxxxxx</p>
<h1 style="font-family:Arial, Helvetica, sans-serif; color:#e4a23f; font-size:16px; font-weight: normal; border-bottom:#e4a23f 1px solid; width: 600px; margin: 10px 25px 0px 25px; padding: 0px 0px 3px 0px;">Comentario desde la Web</h1>
<p style="font-family:Arial, Helvetica, sans-serif; color:#666666; font-size:12px; line-height:18px; width: 600px; margin: 10px 25px 0px 25px; padding:0px;">
Persona de contacto: <span style="color: #333333">'.$_POST["nombre"].'</span><br />
Email: <span style="color: #333333">'.$_POST["email"].'</span><br /></p>
Observaciones</h2><p style="font-family:Arial, Helvetica, sans-serif; color:#333; font-size:12px; line-height: 18px; width: 600px; margin: 10px 25px 0px 25px; padding:0px;">'.nl2br($_POST["mensaje"]).'</p>';
//direccion del remitente
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=utf-8\n";
//direccion del remitente
$headers .= "From: ".$_POST["email"]."\n";
mail($to, $subject, $body, $headers);
$envio_email = 1;
}
if($envio_email == 1) {
header("Location:[COLOR="Red"]http://www.xxxxxxxxxx.es/contacto-confirma.html[/COLOR]");
} else {
header("Location:[COLOR="Red"]http://www.xxxxxxxxxx.es/contacto-error-envio.html[/COLOR]");
}
?> ¿Alguien me haría el favor de probarlo para ver si le envía? Tendría que cambiar lo que esta en rojo
Gracias |