def getstruct(self, msgid, as_json=False, stream=sys.stdout):
        """Get and print the whole message.

        as_json indicates whether to print the part list as JSON or not.
        """
        parts = [part.get_content_type() for hdr, part in self._get(msgid)]
        if as_json:
            print(json.dumps(parts), file=stream)
        else:
            for c in parts:
                print(c, file=stream)
Get and print the whole message.

        as_json indicates whether to print the part list as JSON or not.