Пример #1
0
function mail_get_parts($imap, $mid, $part, $prefix)
{
    $attachments = array();
    $attachments[$prefix] = mail_decode_part($imap, $mid, $part, $prefix);
    if (isset($part->parts)) {
        $prefix = $prefix == "0" ? "" : "{$prefix}.";
        foreach ($part->parts as $number => $subpart) {
            $attachments = array_merge($attachments, mail_get_parts($imap, $mid, $subpart, $prefix . ($number + 1)));
        }
    }
    return $attachments;
}
Пример #2
0
    $pop3_stat = pop3_stat($connection);
    $c->_model->_print($pop3_stat);
    $pop3_list = pop3_list($connection);
    $row_pop3_list = $pop3_list[5];
    $c->_model->_print($row_pop3_list);
    $mid = $row_pop3_list['msgno'];
    $pop3_retr = pop3_retr($connection, $mid);
    //$c->_model->_print($pop3_retr);
    /*$pop3_dele = pop3_retr($connection, $row_pop3_list['msgno']);
    	$c->_model->_print($pop3_dele);*/
    $mail_parse_headers = mail_parse_headers($pop3_retr);
    $c->_model->_print($mail_parse_headers);
    $mail_mime_to_array = mail_mime_to_array($connection, $mid, true);
    $c->_model->_print($mail_mime_to_array);
    $part = imap_fetchstructure($connection, $mid);
    $mail_get_parts = mail_get_parts($connection, $mid, $part, 0);
    $c->_model->_print($mail_get_parts);
    $mail_decode_part = mail_decode_part($connection, $mid, $part, 0);
    $c->_model->_print($mail_decode_part);
}
if (isset($_GET['nhanMail2'])) {
    include_once 'libraries/MixiPOP3/mixipop3.php';
}
function encoding($encoding, $text)
{
    switch ($encoding) {
        # 7BIT
        case 0:
            return $text;
            # 8BIT
        # 8BIT