public function getSection($section, $options = null)
    {
        if (isset($options['class'])) {
            $sectionObj = new $options['class']();
            if ($sectionObj instanceof Section) {
            } else {
                throw new ImapClientException('Incoming class not instance \SSilence\ImapClient\Section');
            }
        } else {
            $sectionObj = new Section();
        }
        if ($section === 0) {
            /*
            If the message id is correct and the structure is returned,
            then there is exactly one section in the message.
            */
            $sectionObj->structure = $this->imapBodystruct(1);
            $sectionObj->body = $this->imapFetchbody(1);
        } else {
            $sectionObj->structure = $this->imapBodystruct($section);
            $sectionObj->body = $this->imapFetchbody($section);
        }

        return $sectionObj;
    }
public function getSection($section, $options = null)
    {
        if (isset($options['class'])) {
            $sectionObj = new $options['class']();
            if ($sectionObj instanceof Section) {
            } else {
                throw new ImapClientException('Incoming class not instance \SSilence\ImapClient\Section');
            }
        } else {
            $sectionObj = new Section();
        }
        if ($section === 0) {
            /*
            If the message id is correct and the structure is returned,
            then there is exactly one section in the message.
            */
            $sectionObj->structure = $this->imapBodystruct(1);
            $sectionObj->body = $this->imapFetchbody(1);
        } else {
            $sectionObj->structure = $this->imapBodystruct($section);
            $sectionObj->body = $this->imapFetchbody($section);
        }

        return $sectionObj;
    }
public function getSection ( $ section , $ options = null ) { if ( isset ( $ options [ 'class' ] ) ) { $ sectionObj = new $ options [ 'class' ] ( ) ; if ( $ sectionObj instanceof Section ) { } else { throw new ImapClientException ( 'Incoming class not instance \SSilence\ImapClient\Section' ) ; } } else { $ sectionObj = new Section ( ) ; } if ( $ section === 0 ) { /*
            If the message id is correct and the structure is returned,
            then there is exactly one section in the message.
            */ $ sectionObj -> structure = $ this -> imapBodystruct ( 1 ) ; $ sectionObj -> body = $ this -> imapFetchbody ( 1 ) ; } else { $ sectionObj -> structure = $ this -> imapBodystruct ( $ section ) ; $ sectionObj -> body = $ this -> imapFetchbody ( $ section ) ; } return $ sectionObj ; }
Get a section message.

Return object with 2 properties:
$obj->structure
$obj->body

@param string     $section
@param array|null $options have one option $options['class']. It create object, which must be instance \SSilence\ImapClient\Section.

@throws ImapClientException

@return \SSilence\ImapClient\Section object
Get a section message .