Php falso envio de datos
Publicado por Abraham Santos (3 intervenciones) el 13/04/2021 21:00:25
hey pido ayuda por que tengo un aparatado de contacto que se supone que envía a correo mensaje antes enviaba pero actualmente no se que paso, todo esta bien escrito pero ya no envía a mi gestor de correos el mensaje correspondiente , me ayudarían porfavor,
El código es este:
Empezamos por el formulario:
después tenemos el enviar.php
y esta el envio:
me ayudan porfavor, es un proyecto urgente.
El código es este:
Empezamos por el formulario:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<section class="form_wrap">
<form action="enviar.php" method="post" class="form_contact">
<h2>Envia un mensaje</h2>
<div class="user_info">
<label for="names">Nombres *</label>
<input type="text" id="names" name="nombre" required>
<label for="phone">Telefono / Celular</label>
<input type="text" id="phone" name="telefono">
<label for="email">Correo electronico *</label>
<input type="text" id="email" name="correo" required>
<label for="mensaje">Mensaje *</label>
<textarea id="mensaje" name="mensaje" required></textarea>
<input type="submit" value="Enviar Mensaje" id="btnSend">
</div>
</form>
</section>
después tenemos el enviar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
// Llamando a los campos
$nombre = $_POST['nombre'];
$correo = $_POST['correo'];
$telefono = $_POST['telefono'];
$mensaje = $_POST['mensaje'];
// Datos para el correo
$destinatario = "mailejemplo@gmail.com";
$asunto = "Contacto desde nuestra web";
$carta = "De: $nombre \n";
$carta .= "Correo: $correo \n";
$carta .= "Telefono: $telefono \n";
$carta .= "Mensaje: $mensaje";
// Enviando Mensaje
mail($destinatario, $asunto, $carta);
header('Location:mensaje-de-envio.html');
?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Formulario de contacto</title>
<link rel="stylesheet" href="css/estilos.css">
<link rel="stylesheet" href="css/font-awesome.css">
<script src="js/jquery-3.2.1.js"></script>
<script src="js/script.js"></script>
</head>
<body>
<section class="form_wrap">
<section class="mensaje-exito">
<h1>SU MENSAJE SE ENVIÓ EXITOSAMENTE</h1>
<a href="index.html">Enviar nuevo mensaje</a>
</section>
</section>
</body>
</html>
Valora esta pregunta


0