Exemplo n.º 1
0
function extract_eml($path)
{
    global $email, $atmail, $auth;
    $email2 = new ReadMsg(array('Username' => $atmail->username, 'Pop3host' => $atmail->pop3host, 'Password' => $auth->password, 'Type' => $atmail->MailType, 'Mode' => $atmail->Mode, 'SessionID' => $auth->SessionID, 'Language' => $atmail->Language, 'DateFormat' => $atmail->DateFormat, 'TimeFormat' => $atmail->TimeFormat, 'LoginType' => $type, 'head' => 1, 'rawemail' => $var['rawemail']));
    $email2->reademail('', '', '', '', $path);
    if ($email2->html) {
        $type = 'html';
    } elseif ($email2->txt) {
        $type = 'txt';
    } elseif ($email2->multiparttxt) {
        $type = 'multiparttxt';
    } else {
        $type = 'html';
    }
    $myvars = array('subject' => $email2->subject, 'from' => htmlentities($email2->from), 'to' => htmlentities($email2->to), 'date' => $email2->date, 'body' => $email2->{$type});
    $fwdmsg = $atmail->parse("html/{$atmail->Language}/fwdmsg.html", $myvars);
    if ($email->html) {
        $email->html .= $fwdmsg;
    } elseif ($email->txt) {
        $email->txt .= $fwdmsg;
    } else {
        $email->html .= $fwdmsg;
    }
    unset($fwdmsg);
    parse_attachments($email2);
    foreach ($email2->attachedemails as $path2) {
        extract_eml($path2);
    }
}