$nombreSitio = "UnMundoEspecial.com.ar";
$direccionSitio = "http://www.unmundoespecial.com.ar/";
$nombreDominio = "unmundoespecila.com.ar";
$paraEmail = "info@unmundoespecial.com.ar";
function invalidMail($email){
if (!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)){
return TRUE;
}else{
return FALSE;
}
}
function stripQuotes($value) {
$value = htmlspecialchars($value);
return str_replace("'", "'", $value);
}
if($_POST[e] == 1){
if(invalidMail($_POST[email])){
$error = "Complete su Email.";
}
if(!$_POST[comments]){
$error = "Complete su consulta a enviar.";
}
if(!$_POST[name]){
$error = "Complete su Nombre y Apellido.";
}
if(!$error){
$_POST[subject] = (!empty($_POST[subject])) ? stripQuotes($_POST[subject]) : "Sin Asunto";
// OPENS TEMPLATE - USERS CONTENTS
unset($final_template);
$template = file("mail_template.php");
if($template){
reset($template);
foreach($template as $line){
foreach($_POST as $name => $value){
$line = str_replace("post" . $name, $value, $line);
$line = str_replace("webpage", $direccionSitio, $line);
}
$final_template .= $line;
}
// HEADERS DEL MAIL Y ENVIO
$subject = $_POST[subject] . " - Formulario recibido desde " . $nombreSitio;
$headers = "From: " . $_POST[email] . " <" . $paraEmail . ">\n";
$headers .= "X-Sender: <" . $paraEmail . ">\n";
$headers .= "X-Mailer: " . $nombreDominio . "\n";
$headers .= "X-Priority: 1\n";
$headers .= "Return-Path: <" . $paraEmail . ">\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";
mail($paraEmail, $subject, $final_template, $headers);
header("location: " . $_SERVER['PHP_SELF'] . "?sent=success");
exit;
}
}
}
?>
Un Mundo Especial
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!$_GET[sent]){
if($error){
?>
=$error?>
}
?>
}else{
?>
El formulario fue enviado exitosamente!
Nos pondremos en contacto con usted a la brevedad
Gracias por utilizar nuestros servicios. |
}
?>
|
|
|
|
|
| |
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
|
|