src/IMAP/Message.php
private function parseHeader() {
        $this->client->openFolder($this->folder_path);
        $this->header = $header = imap_fetchheader($this->client->getConnection(), $this->uid, IMAP::FT_UID);

        $this->priority = $this->extractPriority($this->header);

        if ($this->header) {
            $header = imap_rfc822_parse_headers($this->header);
        }

        if (property_exists($header, 'subject')) {
            if($this->config['decoder']['message']['subject'] === 'utf-8') {
                $this->subject = imap_utf8($header->subject);
            }else{
                $this->subject = mb_decode_mimeheader($header->subject);
            }
        }

        foreach(['from', 'to', 'cc', 'bcc', 'reply_to', 'sender'] as $part){
            $this->extractHeaderAddressPart($header, $part);
        }

        if (property_exists($header, 'references')) {
            $this->references = $header->references;
        }
        if (property_exists($header, 'in_reply_to')) {
            $this->in_reply_to = str_replace(['<', '>'], '', $header->in_reply_to);
        }
        if (property_exists($header, 'message_id')) {
            $this->message_id = str_replace(['<', '>'], '', $header->message_id);
        }
        if (property_exists($header, 'Msgno')) {
            $messageNo = (int) trim($header->Msgno);
            $this->message_no = ($this->fetch_options == IMAP::FT_UID) ? $messageNo : imap_msgno($this->client->getConnection(), $messageNo);
        } else {
            $this->message_no = imap_msgno($this->client->getConnection(), $this->getUid());
        }

        $this->date = $this->parseDate($header);
    }
private function parseHeader() {
        $this->client->openFolder($this->folder_path);
        $this->header = $header = imap_fetchheader($this->client->getConnection(), $this->uid, IMAP::FT_UID);

        $this->priority = $this->extractPriority($this->header);

        if ($this->header) {
            $header = imap_rfc822_parse_headers($this->header);
        }

        if (property_exists($header, 'subject')) {
            if($this->config['decoder']['message']['subject'] === 'utf-8') {
                $this->subject = imap_utf8($header->subject);
            }else{
                $this->subject = mb_decode_mimeheader($header->subject);
            }
        }

        foreach(['from', 'to', 'cc', 'bcc', 'reply_to', 'sender'] as $part){
            $this->extractHeaderAddressPart($header, $part);
        }

        if (property_exists($header, 'references')) {
            $this->references = $header->references;
        }
        if (property_exists($header, 'in_reply_to')) {
            $this->in_reply_to = str_replace(['<', '>'], '', $header->in_reply_to);
        }
        if (property_exists($header, 'message_id')) {
            $this->message_id = str_replace(['<', '>'], '', $header->message_id);
        }
        if (property_exists($header, 'Msgno')) {
            $messageNo = (int) trim($header->Msgno);
            $this->message_no = ($this->fetch_options == IMAP::FT_UID) ? $messageNo : imap_msgno($this->client->getConnection(), $messageNo);
        } else {
            $this->message_no = imap_msgno($this->client->getConnection(), $this->getUid());
        }

        $this->date = $this->parseDate($header);
    }
private function parseHeader ( ) { $ this -> client -> openFolder ( $ this -> folder_path ) ; $ this -> header = $ header = imap_fetchheader ( $ this -> client -> getConnection ( ) , $ this -> uid , IMAP :: FT_UID ) ; $ this -> priority = $ this -> extractPriority ( $ this -> header ) ; if ( $ this -> header ) { $ header = imap_rfc822_parse_headers ( $ this -> header ) ; } if ( property_exists ( $ header , 'subject' ) ) { if ( $ this -> config [ 'decoder' ] [ 'message' ] [ 'subject' ] === 'utf-8' ) { $ this -> subject = imap_utf8 ( $ header -> subject ) ; } else { $ this -> subject = mb_decode_mimeheader ( $ header -> subject ) ; } } foreach ( [ 'from' , 'to' , 'cc' , 'bcc' , 'reply_to' , 'sender' ] as $ part ) { $ this -> extractHeaderAddressPart ( $ header , $ part ) ; } if ( property_exists ( $ header , 'references' ) ) { $ this -> references = $ header -> references ; } if ( property_exists ( $ header , 'in_reply_to' ) ) { $ this -> in_reply_to = str_replace ( [ '<' , '>' ] , '' , $ header -> in_reply_to ) ; } if ( property_exists ( $ header , 'message_id' ) ) { $ this -> message_id = str_replace ( [ '<' , '>' ] , '' , $ header -> message_id ) ; } if ( property_exists ( $ header , 'Msgno' ) ) { $ messageNo = ( int ) trim ( $ header -> Msgno ) ; $ this -> message_no = ( $ this -> fetch_options == IMAP :: FT_UID ) ? $ messageNo : imap_msgno ( $ this -> client -> getConnection ( ) , $ messageNo ) ; } else { $ this -> message_no = imap_msgno ( $ this -> client -> getConnection ( ) , $ this -> getUid ( ) ) ; } $ this -> date = $ this -> parseDate ( $ header ) ; }
Parse all defined headers

@return void
@throws Exceptions\ConnectionFailedException
@throws InvalidMessageDateException
Parse all defined headers