Пример #1
0
function notificarLista($path_db, $noticia, $pearl)
{
    if ($pearl) {
        require_once "Mail.php";
    }
    $xml = simplexml_load_file($path_db);
    $totales = (string) $xml->totales;
    $notificados = 0;
    list($para, $host) = mailConfigSinAuth();
    $de = "<" . $para . ">";
    foreach ($xml->persona as $persona) {
        if ($pearl) {
            enviar_pearl($persona["nombre"], "<" . $persona["mail"] . ">", $noticia, $de, $host);
        } else {
            enviar_php($persona["nombre"], $persona["mail"], $noticia, $de);
        }
        $notificados = $notificados + 1;
    }
    return $notificados . ' de ' . $totales;
}
Пример #2
0
function envioPEARL()
{
    //Envio Mail
    list($para, $host) = mailConfigSinAuth();
    //ini_set("include_path","../../altausuarios/Alta/php");
    require_once "Mail.php";
    $mensaje = "El usuario de nombre: " . $_POST["form-nombre"] . "\n\n             Ha escrito:\n\t" . $_POST["form-mensaje"];
    $from = "<" . $_POST["form-email"] . ">";
    // . ' <'.$username.'>';
    //$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;
}