_error = $error;
}
function setDesde ($desde)
{
$this->desde = $desde;
}
function getDesde ()
{
return $this->desde;
}
function setPara ($para)
{
$this->para = $para;
}
function getPara ()
{
return $this->para;
}
function setNombre ($nombre)
{
$this->nombre = $nombre;
}
function getNombre ()
{
return $this->nombre;
}
function setMotivoConsulta ($motivoConsulta)
{
$this->motivoConsulta = $motivoConsulta;
}
function getMotivoConsulta ()
{
return $this->motivoConsulta;
}
function setComentario ($comentario)
{
$this->comentario = $comentario;
}
function getComentario ()
{
return $this->comentario;
}
function enviarEmail()
{
//Encabezados
$header="From:".$this -> desde."\nReply-To:".$this -> desde."\n";
$header=$header."X-Mailer:PHP/".phpversion()."\n";
$header=$header."Mime-Version: 1.0\n";
$header=$header."Content-Type: text/html";
$txtema="Contacto: ".$this -> motivoConsulta;
$cab="
Comentario de coinn.com.ar";
//El Mensaje
$mensaje="Datos del formulario de contacto
"."\n";
$mensaje=$mensaje."
";
$mensaje=$mensaje."Nombre: ".$this -> nombre."
";
$mensaje=$mensaje."Motivo de la Consulta: ".$this -> motivoConsulta."
";
$mensaje=$mensaje."Email: ".$this -> para."
";
$mensaje=$mensaje."Comentarios: ".$this -> comentario."
";
$mensaje_a_mostrar=nl2br($mensaje);
$fin="";
$txdetalle=$cab.$mensaje_a_mostrar.$fin;
@mail($this -> para,$txtema,$txdetalle,$header);
return true;
}
function validarEmail($email)
{
//return true;
$nonascii = "\x80-\xff"; # Non-ASCII-Chars are not allowed
$nqtext = "[^\\\\$nonascii\015\012\"]";
$qchar = "\\\\[^$nonascii]";
$protocol = '(?:mailto:)';
$normuser = '[a-zA-Z0-9][a-zA-Z0-9_.-]*';
$quotedstring = "\"(?:$nqtext|$qchar)+\"";
$user_part = "(?:$normuser|$quotedstring)";
$dom_mainpart = '[a-zA-Z0-9][a-zA-Z0-9._-]*\\.';
$dom_subpart = '(?:[a-zA-Z0-9][a-zA-Z0-9._-]*\\.)*';
$dom_tldpart = '[a-zA-Z]{2,5}';
$domain_part = "$dom_subpart$dom_mainpart$dom_tldpart";
$regex = "$protocol?$user_part\@$domain_part";
// RegEx end
return preg_match("/^$regex$/",$email);
}
}
?>