Hi saisuneel,
When you get x part of the MIME message, you can use ${<MIME message>.parts.x.body} for text, and ${<MIME message>.parts.x} for binary.
When you want to construct a MIME message (to send to back end),
1. message Content-Type:
multipart/mixed;boundary=XXXXboundary
2. message body:
--XXXXboundary
Content-Type: text/plain
this is the body text
--XXXXboundary
Content-Description: File Transfer
Content-Disposition: attachment;filename="test.txt"
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Expires: 0
Cache-Control: must-revalidate, post-check=0, pre-check=0
Pragma: public
${attachment}
--XXXXboundary--