protected function getBody()
    {
        $objNew = new \stdClass();
        $i = 1;
        $subType = new SubtypeBody();
        foreach ($this->getSections(self::SECTION_BODY) as $section) {
            $obj = $this->getSection($section, array('class' => $subType));
            $subtype = strtolower($obj->__get('structure')->subtype);
            if (!isset($objNew->$subtype)) {
                $objNew->$subtype = $obj;
            } else {
                $subtype = $subtype.'_'.$i;
                $objNew->$subtype = $obj;
                $i++;
            }
            $objNew->info[] = $obj;
            $objNew->types[] = $subtype;
            /*
             * Set charset
             */
            foreach ($objNew->$subtype->__get('structure')->parameters as $parameter) {
                $attribute = strtolower($parameter->attribute);
                if ($attribute === 'charset') {
                    $value = strtolower($parameter->value);
                    /*
                     * Here must be array, but
                     */
                    //$objNew->$subtype->charset[] = $value;
                    $objNew->$subtype->charset = $value;
                }
            }
        }
        if (isset($objNew->plain)) {
            switch ($objNew->plain->structure->encoding) {
                case 3:
                    $objNew->text = imap_base64(mb_convert_encoding( $objNew->plain, "utf-8", $objNew->plain->charset ));
                    break;
                default:
                    $objNew->text = quoted_printable_decode(mb_convert_encoding( $objNew->plain, "utf-8", $objNew->plain->charset ));
                    break;
            }
            $objNew->types[] = 'text';
        } else {
            $objNew->text = null;
        }
        $this->message = $objNew;
    }
protected function getBody()
    {
        $objNew = new \stdClass();
        $i = 1;
        $subType = new SubtypeBody();
        foreach ($this->getSections(self::SECTION_BODY) as $section) {
            $obj = $this->getSection($section, array('class' => $subType));
            $subtype = strtolower($obj->__get('structure')->subtype);
            if (!isset($objNew->$subtype)) {
                $objNew->$subtype = $obj;
            } else {
                $subtype = $subtype.'_'.$i;
                $objNew->$subtype = $obj;
                $i++;
            }
            $objNew->info[] = $obj;
            $objNew->types[] = $subtype;
            /*
             * Set charset
             */
            foreach ($objNew->$subtype->__get('structure')->parameters as $parameter) {
                $attribute = strtolower($parameter->attribute);
                if ($attribute === 'charset') {
                    $value = strtolower($parameter->value);
                    /*
                     * Here must be array, but
                     */
                    //$objNew->$subtype->charset[] = $value;
                    $objNew->$subtype->charset = $value;
                }
            }
        }
        if (isset($objNew->plain)) {
            switch ($objNew->plain->structure->encoding) {
                case 3:
                    $objNew->text = imap_base64(mb_convert_encoding( $objNew->plain, "utf-8", $objNew->plain->charset ));
                    break;
                default:
                    $objNew->text = quoted_printable_decode(mb_convert_encoding( $objNew->plain, "utf-8", $objNew->plain->charset ));
                    break;
            }
            $objNew->types[] = 'text';
        } else {
            $objNew->text = null;
        }
        $this->message = $objNew;
    }
protected function getBody ( ) { $ objNew = new \ stdClass ( ) ; $ i = 1 ; $ subType = new SubtypeBody ( ) ; foreach ( $ this -> getSections ( self :: SECTION_BODY ) as $ section ) { $ obj = $ this -> getSection ( $ section , array ( 'class' => $ subType ) ) ; $ subtype = strtolower ( $ obj -> __get ( 'structure' ) -> subtype ) ; if ( ! isset ( $ objNew -> $ subtype ) ) { $ objNew -> $ subtype = $ obj ; } else { $ subtype = $ subtype . '_' . $ i ; $ objNew -> $ subtype = $ obj ; $ i ++ ; } $ objNew -> info [ ] = $ obj ; $ objNew -> types [ ] = $ subtype ; /*
             * Set charset
             */ foreach ( $ objNew -> $ subtype -> __get ( 'structure' ) -> parameters as $ parameter ) { $ attribute = strtolower ( $ parameter -> attribute ) ; if ( $ attribute === 'charset' ) { $ value = strtolower ( $ parameter -> value ) ; /*
                     * Here must be array, but
                     */ //$objNew->$subtype->charset[] = $value; $ objNew -> $ subtype -> charset = $ value ; } } } if ( isset ( $ objNew -> plain ) ) { switch ( $ objNew -> plain -> structure -> encoding ) { case 3 : $ objNew -> text = imap_base64 ( mb_convert_encoding ( $ objNew -> plain , "utf-8" , $ objNew -> plain -> charset ) ) ; break ; default : $ objNew -> text = quoted_printable_decode ( mb_convert_encoding ( $ objNew -> plain , "utf-8" , $ objNew -> plain -> charset ) ) ; break ; } $ objNew -> types [ ] = 'text' ; } else { $ objNew -> text = null ; } $ this -> message = $ objNew ; }
Get body current message.

Set
$this->message->$subtype
$this->message->$subtype->charset
$this->message->text
$this->message->info[]
$this->message->types[]

@return object
Get body current message .