예제 #1
0
<?php

$_SESSION["path"] = "../../";
include $_SESSION["path"] . "php-functions/funciones.php";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $name = $_POST['name'];
    $email = $_POST['email'];
    if (strlen($name) > 0 && strlen($email) > 0) {
        $archivo = $_SESSION["path"] . "noticias/suscribirse/nuevos.txt";
        if (grabar_suscripcion($archivo, $name, $email)) {
            echo '<p style="font-size:18px;">Felicitaciones, ya es parte de nuestro newsletter</p>';
            //avisa que se meteio alguien
            $para = "*****@*****.**";
            $message = "Eh loco, alguien se te suscribio, agregalo a la lista";
            envioPEARL($name, $email, $message, $para);
        } else {
            echo '<p style="font-size:18px;color:red;">Ha ocurrido un error, inténtelo nuevamente más tarde</p>';
        }
    }
}
예제 #2
0
    //$to = "<".$para.">";
    $to = "<*****@*****.**>";
    $subject = "Contacto - Pagina web";
    $body = "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t\t<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>\n                                <head>\n\t\t\t\t\t<title>Contacto</title>\n\t\t\t\t\t</head>\n                                        <body>" . $mensaje . "\n\t\t\t\t\t</body>\n\t\t\t\t</html>";
    $headers = array('From' => $from, 'To' => $to, 'Subject' => $subject, 'Content-type' => 'text/html');
    $smtp = Mail::factory('smtp', array('host' => $host, 'auth' => false));
    $mail = $smtp->send($to, $headers, $body);
    if (PEAR::isError($mail)) {
        echo $errorGeneral;
        return false;
    }
    return true;
}
//http://www.tallerwebmaster.com/tutorial/formulario-de-contacto-enviar-mail-con-php/43/
//$res = bleh();
$res = envioPEARL();
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />

    <style type="text/css" media="screen">
    <!--
        BODY { margin: 10px; padding: 0; font: 1em "Trebuchet MS", verdana, arial, sans-serif; font-size: 100%; }
        H1 { margin-bottom: 2px; }

        DIV#loader {