def content(self):
        """Function returns the body of the as2 payload as a bytes object"""

        if not self.payload:
            return ''

        if self.payload.is_multipart():
            message_bytes = mime_to_bytes(
                self.payload, 0).replace(b'\n', b'\r\n')
            boundary = b'--' + self.payload.get_boundary().encode('utf-8')
            temp = message_bytes.split(boundary)
            temp.pop(0)
            return boundary + boundary.join(temp)
        else:
            content = self.payload.get_payload()
            if isinstance(content, str_cls):
                content = content.encode('utf-8')
            return content
def content ( self ) : if not self . payload : return '' if self . payload . is_multipart ( ) : message_bytes = mime_to_bytes ( self . payload , 0 ) . replace ( b'\n' , b'\r\n' ) boundary = b'--' + self . payload . get_boundary ( ) . encode ( 'utf-8' ) temp = message_bytes . split ( boundary ) temp . pop ( 0 ) return boundary + boundary . join ( temp ) else : content = self . payload . get_payload ( ) if isinstance ( content , str_cls ) : content = content . encode ( 'utf-8' ) return content
Function returns the body of the as2 payload as a bytes object