Ver Mensaje Individual
  #5 (permalink)  
Antiguo 01/08/2005, 21:57
Computer XTress
 
Fecha de Ingreso: diciembre-2004
Mensajes: 721
Antigüedad: 19 años, 3 meses
Puntos: 2
Hola, gracias por responder.

Estuve observando la diferencia entre GET y POST y note que no me era necesario en lo absoluto pasarlos por GET, por ende utilice POST.

Pero nuevamente me encontre con el mismo problema... les muestro el codigo de mi script:

// SENDMAIL.PHP --------------

<?php

$de = $_POST[origen];
$de_mail = $_POST[origen_mail];
$para = $_POST[destino];
$para_mail = $_POST[destino_mail];
$asunto = $_POST[asunt];
$texto = $_POST[mensaj];

if ($de && $de_mail && $para && $para_mail && $asunto && $texto) {


$mensaje = "
<html>
<head>
<title> Mensaje automatico </html>
</head>

<body>
Hola <b>" . $para . "</b>!<br><br> <b>" . $de . "</b> te envia el siguiente mensaje: <br><br>
<p>" . $texto . "</p><br><br>
<b> Adios! </b>
</body>
</html>";

// Cabeceras para HTML

$cabeceras = "MIME-Version: 1.0\r\n";
$cabeceras .= "Content-type: text/html; charset=utf-8\r\n";

// Info del mensaje:

$cabeceras .= "To: " . $para . " " . $para_mail . "\r\n";
$cabeceras .= "From: " . $de . " " . $de_mail . "\r\n";

mail($para_mail, $asunto, $mensaje, $cabeceras);

echo "<br><br> El mensaje fue enviado con exito a " . $para_mail . "\n";

} else { echo "Faltan datos para completar la operacion!"; };


?>

// SENDMAIL.PHP ------------ FIN

y el formulario en HTML

// MAILFORM.HTML -------------
<html>
<head>
<title> Formulario de envio de emails</title>
</head>

<body>
<h2> Completa los siguientes datos para enviar un email </h2><br><br>

<form action="sendmail.php" method="post"><br>
Tu nombre: <input type="text" name="origen"><br>
Tu email: <input type="text" name="origen_mail"><br>
Destinatario (nombre): <input type="text" name="destino"><br>
Destinatario (email): <input type="text" name="destino_mail"><br>
Asunto: <Input type="text" name="asunt"><br>
Mensaje: <textarea name="mensaj" rows="10" cols="30"></textarea><br><br>

<Input type="submit" name="Enviar!" value="Enviar!">


</body>

</html>

// MAILFORM.HTML -------- FIN


¿Utilizando POST deberian pasarse los caracteres \n\r etc?