Código PHP:
<?php
function quitar($mensaje)
{
$mensaje = str_replace("<","<",$mensaje);
$mensaje = str_replace(">",">",$mensaje);
$mensaje = str_replace("\'","'",$mensaje);
$mensaje = str_replace('\"',""",$mensaje);
$mensaje = str_replace("\\\\","\",$mensaje);
return $mensaje;
}
function comprobar_email($email){
$mail_correcto = 0;
if ((strlen($email) >= 6) && (substr_count($email,"@") == 1) && (substr($email,0,1) != "@") && (substr($email,strlen($email)-1,1) != "@")){
if ((!strstr($email,"'")) && (!strstr($email,"\"")) && (!strstr($email,"\\")) && (!strstr($email,"\$")) && (!strstr($email," "))) {
if (substr_count($email,".")>= 1){
$term_dom = substr(strrchr ($email, '.),1);
if (strlen($term_dom)>1 && strlen($term_dom)<5 && (!strstr($term_dom,"@")) ){
$antes_dom = substr($email,0,strlen($email) - strlen($term_dom) - 1);
$caracter_ult = substr($antes_dom,strlen($antes_dom)-1,1);
if ($caracter_ult != "@" && $caracter_ult != "."){
$mail_correcto = 1;
}
}
}
}
}
if ($mail_correcto)
return 1;
else
return 0;
}
$comp_email = quitar($HTTP_POST_VARS["email"]);
$i = comprobar_email($comp_email);
if ($i != 0)
{
$sendTo = "[email protected]";
$subject = $_POST["asunto"];
$headers = "From: " . $_POST["HB-Europe_WEB"];
$headers .= "<" . $_POST["email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["email"];
$message = $_POST["cuerpo"];
mail($sendTo, $subject, $message, $headers);
echo "&estatus=OK&";
}
else
{
echo "&estatus=email&";
}
?>
Código PHP:
$sendTo = "[email protected]";
$subject = $_POST["asunto"];
$headers = "From: " . $_POST["HB-Europe_WEB"];
$headers .= "<" . $_POST["email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["email"];
$message = $_POST["cuerpo"];
mail($sendTo, $subject, $message, $headers);
¡Alguna ayuda por favor!
ArgoN