Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/10/2015, 17:20
bostero
 
Fecha de Ingreso: octubre-2015
Mensajes: 3
Antigüedad: 8 años, 6 meses
Puntos: 0
Problema con un ANONYMOUS

hola estimados...
La verdad es que estuve tratando de resolver esto pero no veo como solucionarlo, soy diseñador y no programador :(... en este foro hubo hace un tiempo un problema parecido y pese a que les y releí las respuestas no hubo caso así que me decidí a preguntarles.
Tengo este archivo php. el tema es que la respuesta viene con un remitente raro, dice [email protected]. Y ya traté todo y no sé como hacer para que aparezca primero DE:el mail del que escribe el formulario y el PARA: en este caso seria yo. Podrían darme una mano PORFAVORRRR!!!!!!!!!!!!
Además lo toque tanto que ahora no me sale ni siquiera Consulta
gracias por la ayuda que puedan darme...

_____
<?php
/* Set e-mail recipient */
$to= "[email protected]";
$sub= $name." envio una consulta desde formulario.";
$headers = "From: $nombre <$email>\n";
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n";
/* Check all form inputs using check_input function */
$name = check_input($_POST['inputName'], "Nombre y apellido");
$email = check_input($_POST['inputEmail'], "Un correo válido");
$telef = check_input($_POST['inputTelef'], "Celular o fijo");
$message = check_input($_POST['inputMessage'], "Por favor, escriba su consulta");
if (mail($email,"Consulta desde formulario",$message,$headers))


/* If e-mail is not valid show error message */
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $email))
{
show_error("Direccion de email erronea");
}
/* Let's prepare the message for the e-mail */

$subject = "Consulta";

$message = "

Un visitante le envió una Consulta:

Name: $name
Email: $email
Telefono: $telef
Message: $message

";

/* Send the message using mail() function */
mail($to, $telef, $message);

/* Redirect visitor to the thank you page */
header('Location: thnks.html');
exit();

/* Functions we used */
function check_input($data, $problem='')
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
{
show_error($problem);
}
return $data;
}

function show_error($myError)
{
?>
<html>
<body>

<p>Por favor, corrija el error:</p>
<strong><?php echo $myError; ?></strong>
<p>Pulse el boton de VOLVER (Back) e intentelo nuevamente, Gracias</p>

</body>
</html>
<?php
exit();
}
?>