protected function addAttachmentBody(array $body)
    {
        foreach ($this->attachments as $attachment) {
            list($name, $data, $mime) = $attachment;
            $mime   = $mime ? $mime : MimeType::getMimeType($name);
            $data   = base64_encode($data);
            $count  = ceil(strlen($data) / 998);
            
            $body[] = '--'.$this->boundary[1];
            $body[] = 'Content-type: '.$mime.'; name="'.$name.'"';
            $body[] = 'Content-disposition: attachment; filename="'.$name.'"';
            $body[] = 'Content-transfer-encoding: base64';
            $body[] = null;
            
            for ($i = 0; $i < $count; $i++) {
                $body[] = substr($data, ($i * 998), 998);
            }
            
            $body[] = null;
            $body[] = null;
        }
        
        $body[] = '--'.$this->boundary[1].'--';
        
        return $body;
    }
protected function addAttachmentBody(array $body)
    {
        foreach ($this->attachments as $attachment) {
            list($name, $data, $mime) = $attachment;
            $mime   = $mime ? $mime : MimeType::getMimeType($name);
            $data   = base64_encode($data);
            $count  = ceil(strlen($data) / 998);
            
            $body[] = '--'.$this->boundary[1];
            $body[] = 'Content-type: '.$mime.'; name="'.$name.'"';
            $body[] = 'Content-disposition: attachment; filename="'.$name.'"';
            $body[] = 'Content-transfer-encoding: base64';
            $body[] = null;
            
            for ($i = 0; $i < $count; $i++) {
                $body[] = substr($data, ($i * 998), 998);
            }
            
            $body[] = null;
            $body[] = null;
        }
        
        $body[] = '--'.$this->boundary[1].'--';
        
        return $body;
    }
protected function addAttachmentBody ( array $ body ) { foreach ( $ this -> attachments as $ attachment ) { list ( $ name , $ data , $ mime ) = $ attachment ; $ mime = $ mime ? $ mime : MimeType :: getMimeType ( $ name ) ; $ data = base64_encode ( $ data ) ; $ count = ceil ( strlen ( $ data ) / 998 ) ; $ body [ ] = '--' . $ this -> boundary [ 1 ] ; $ body [ ] = 'Content-type: ' . $ mime . '; name="' . $ name . '"' ; $ body [ ] = 'Content-disposition: attachment; filename="' . $ name . '"' ; $ body [ ] = 'Content-transfer-encoding: base64' ; $ body [ ] = null ; for ( $ i = 0 ; $ i < $ count ; $ i ++ ) { $ body [ ] = substr ( $ data , ( $ i * 998 ) , 998 ) ; } $ body [ ] = null ; $ body [ ] = null ; } $ body [ ] = '--' . $ this -> boundary [ 1 ] . '--' ; return $ body ; }
Adds the attachment string body
for plain text emails

@param *array $body The body types

@return array
Adds the attachment string body for plain text emails