![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
13/12/2006, 09:43
|
![Avatar de Stephano](http://static.forosdelweb.com/customavatars/avatar104875_3.gif) | | | Fecha de Ingreso: junio-2005 Ubicación: Arequipa
Mensajes: 392
Antigüedad: 19 años, 8 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\">";
}
?> |