Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/12/2006, 09:43
Avatar de Stephano
Stephano
 
Fecha de Ingreso: junio-2005
Ubicación: Arequipa
Mensajes: 392
Antigüedad: 21 años, 3 meses
Puntos: 3
Re: Remitente en correo php

Código PHP:
<?php
// get posted data into local variables
$EmailFrom = "[email protected]";
$EmailTo = "[email protected]";
$Subject = "consulta";
$Name = Trim(stripslashes($_POST['Name'])); 
$email = Trim(stripslashes($_POST['email'])); 
$msg = Trim(stripslashes($_POST['msg'])); 

// validation
$validationOK=true;
if (!
$validationOK) {
  print 
"<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
  exit;
}

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "email: ";
$Body .= $email;
$Body .= "\n";
$Body .= "msg: ";
$Body .= $msg;
$Body .= "\n";

// send email 
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page 
if ($success){
  print 
"<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
  print 
"<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
__________________
www.percyweb.com - mi Blog