Ver Mensaje Individual
  #6 (permalink)  
Antiguo 14/01/2008, 16:21
Avatar de hgp147
hgp147
 
Fecha de Ingreso: diciembre-2006
Ubicación: Buenos Aires, Argentina
Mensajes: 980
Antigüedad: 17 años, 4 meses
Puntos: 36
Re: Código envio Email

Hola, te faltaba agregar $_POST.
Lo probe en mi pc y anda bien.

simple_form.html

Código HTML:
<html>
<head>
<title>Formulario de envio</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form method="post" action="send_simpleform.php">

<p><strong>Tu nombre:</strong><br>
<input type="text" name="nombre" size=30></p>

<p><strong>Tu dirección de Email:</strong><br>
<input type="text" name="email" size=30></p>

<p><strong>Mensaje:</strong><br>
<textarea name="mensaje" cols=30 rows=5 wrap=virtual> </textarea></p>

<P><input type="submit" name="submit" value="Envia estos datos"></p>
</form>
</body>
</html> 

send_simpleform.php

Código PHP:
<?

$nombre 
$_POST["nombre"];

$email $_POST["email"];

$mensaje $_POST["mensaje"];


if ((
$nombre == "") || ($email == "") || ($mensaje == "")) {
header("Location: simple_form.html");
exit;
}

$msg "ESTOS SON LOS DATOS RECIBIDOS:\n";
$msg .= "Nombre: $nombre\n";
$msg .= "E-Mail: $email\n";
$msg .= "Mensaje: $mensaje\n\n";

$to "[email protected]";
$subject "$nombre,solicita más información";
$mailheaders "From: [email protected]\n";
$mailheaders .= "Reply-To: $email\n\n";

mail($to$subject$msg$mailheaders);
?>

<html>
<head>
<title>Envio Email</title>
</head>
<body>

<H1>El siguiente Email ha sido enviado con los siguientes datos:</H1>

<p><strong>Tu nombre:</strong><br>
<? echo "$nombre"?>

<p><strong>Tu Email:</strong><br>
<? echo "$email"?>

<p><strong>Mensaje:</strong><br>
<? echo "$mensaje"?>

</body>
</html>