Exemplo n.º 1
0
            echo $pop3->error;
            return;
        }
    } else {
        echo $pop3->error;
        return;
    }
} else {
    echo $pop3->error;
    return;
}
$db["link"] = mysql_connect($db["addr"], $db["user"], $db["pass"]) or die(mysql_error());
mysql_select_db($db["use"], $db["link"]) or die(mysql_error());
$noob = TRUE;
for ($i = 1; $i <= $msg_list["count_mails"]; $i++) {
    if (!($header = $pop3->get_top($i))) {
        echo $pop3->error;
    }
    // Get Message ID and set $unique_id for save2file()
    $g = 0;
    while (!ereg("</HEADER>", $header[$g])) {
        if (eregi("Message-ID", $header[$g])) {
            $unique_id = md5($header[$g]);
        }
        $g++;
    }
    unset($g);
    $query = 'SELECT `unique_id` FROM `' . $msg_table . '` WHERE 1 AND `unique_id` = \'' . $unique_id . '\' LIMIT 0, 1';
    $result = mysql_query($query, $db["link"]) or die(mysql_error());
    if ($rows = mysql_fetch_array($result)) {
        $get_msg = FALSE;