Ejemplo n.º 1
0
    include_once "./library/mime_mail.inc";
    $content_type = "application/octet-stream";
    # read a JPEG picture from the disk
    $fd = fopen($filename, "r");
    $data = fread($fd, filesize($filename));
    fclose($fd);
    # create object instance
    $mail = new mime_mail();
    # set all data slots
    $mail->from = $from;
    $mail->to = $email;
    $mail->subject = $predmet;
    $mail->body = $text;
    # append the attachment
    $filename = $zipdir . "/" . $_SESSION['step_all_4']['presentation_name'] . ".zip";
    $mail->add_attachment($data, $filename, $content_type);
    # send e-mail
    if ($mail->send()) {
        echo "<h2 class=\"ok\">" . $webgen_send_to_email_send[$language] . "</h2>";
    } else {
        echo "<h2 class=\"error\">" . $webgen_send_to_email_error[$language] . "</h2>";
    }
    if ("c" == $_SESSION['step_pp_20']['send_choice']) {
        if (strlen($_SESSION['step_all_2']['user_name']) > 2 && strlen($_SESSION['step_all_4']['presentation_name']) > 2) {
            recursive_remove_directory("./presentations/" . $_SESSION['step_all_2']['user_name'] . "/" . $_SESSION['step_all_4']['presentation_name']);
        } else {
            echo "<h2 class=\"error\">" . $webgen_delete_error[$language] . "</h2>";
        }
    }
}
?>