Ejemplo n.º 1
0
OpenTable();
echo "<script language=\"javascript\">\n" . "function open_w(file) {\n" . "    newwin = window.open(file,'Attachments','width=800, height=600, toolbar=no');\n" . "}\n" . "</script>\n";
echo "<table border=\"0\" width=\"100%\">\n    <tr>\n    <td align=\"left\" class='bg2' bgcolor=\"{$bgcolor2}\"><b>" . _MD_WEBMAIL_MAIL_FROM . ":</b></td>\n    <td>" . htmlspecialchars($from_address) . " <small>[ <a href=\"./contactbook.php?op=addnew&amp;from=" . rawurlencode($from_address) . "&amp;id={$id}\">" . _MD_WEBMAIL_ADD_ADR_BOOK . "</a> ]</small></td>\n    </tr>\n    <tr>\n    <td align=\"left\" class='bg2' bgcolor=\"{$bgcolor2}\"><b>" . _MD_WEBMAIL_TO . ":</b></td>\n    <td>" . htmlspecialchars($to_address) . "</td>\n    </tr>";
if ($cc != "") {
    echo "<tr>\n\t<td align=\"left\" class='bg2' bgcolor=\"{$bgcolor2}\"><b>Cc:</b></td>\n        <td>" . htmlspecialchars($cc) . "</td>\n        </tr>";
}
echo "<tr>\n    <td align=\"left\" class='bg2' bgcolor=\"{$bgcolor2}\"><b>" . _MD_WEBMAIL_MAIL_SUBJECT . ":</b></td>\n    <td>" . htmlspecialchars($subject) . "</td>\n    </tr><tr>\n    <td align=\"left\" class='bg2' bgcolor=\"{$bgcolor2}\"><b>" . _MD_WEBMAIL_MAIL_DATE . ":</b></td>\n    <td>" . $d->Headers("Date") . "</td>\n    </tr><tr>\n    <td colspan=2>\n    <table border=0 width=100% cellspacing=0><tr><td class='bg2' bgcolor={$bgcolor2}>\n    <table border=0 width=100% cellspacing=5 cellpadding=0><tr><td bgcolor=\"{$bgcolor2}\">\n    <form action='inbox.php' method=\"post\">\n    <input type=hidden name=\"id\" value=\"{$id}\">\n    <input type=hidden name=\"op\" value=\"delete\">\n    <input type=hidden name=\"msgid\" value=\"{$msgid}\">\n    <input type=submit value=\"" . _MD_WEBMAIL_DELETE . "\">";
echo "</form>";
if ($email_send == 1) {
    echo "</td><td bgcolor=\"{$bgcolor2}\" class='bg2'>\n\t<form action='compose.php' method=\"post\" name=\"f_rep\">\n\t<input type=hidden name=to value=\"" . htmlspecialchars($reply_address) . "\">\n\t<input type=hidden name=subject value=\"" . htmlspecialchars($subject) . "\">\n\t<input type=hidden name=body value=\"\">\n\t<input type=hidden name=op value=\"reply\">\n\t<input type=hidden name=id value=\"{$id}\">\n\t<input type=submit value=\"" . _MD_WEBMAIL_REPLY . "\">\n\t</form>\n\t</td><td bgcolor=\"{$bgcolor2}\" width=\"100%\" class='bg2'>\n\t<form action='compose.php' method=\"post\" name=\"f_del\">\n\t<input type=hidden name=\"to\" value=\"\">\n\t<input type=hidden name=\"subject\" value=\"" . htmlspecialchars($subject) . "\">\n\t<input type=hidden name=\"body\" value=\"\">\n\t<input type=hidden name=\"op\" value=\"forward\">\n\t<input type=hidden name=id value=\"{$id}\">\n\t<input type=submit value=\"" . _MD_WEBMAIL_FORWARD . "\">\n\t</form>";
}
echo "</td></tr></table></tr></td></table></td></tr><tr><td colspan=2 bgcolor=\"{$bgcolor2}\" class='bg2'>";
if ($filter_forward == '1') {
    $rep_header = "-----Original Message-----\\nFrom: " . $from_address . "\\nSent: " . $d->Headers("Date") . "\\nTo: " . $to_address . "\\nSubject: " . $subject . "\\n\\n";
}
$message = $d->Result();
// nao-pon wrote
$http_URL_regex = '#(https?://[-_.!~*\'()a-zA-Z0-9;/?:@&=+$,%\\#]+)#';
$mail_ADR_regex = '#((mailto:)?([0-9A-Za-z._-]+@[0-9A-Za-z.-]+))#';
//echo "email_send:$email_send";
// edit end.
$rtext = "";
//var_dump($message);
$echo = $html = $htmls = $text = '';
for ($j = 0; $j < count($message); $j++) {
    $found_text = false;
    $found_html = false;
    for ($i = 0; $i < count($message[$j]); $i++) {
        if (chop($message[$j][$i]["attachments"]) != '') {
            $filename = mb_convert_encoding($message[$j][$i]["attachments"], _CHARSET, "AUTO");
            $filename = urlencode($filename);