def get_content_type(self, msg, content_type="<STR_LIT>"):
if "<STR_LIT>" in content_type.upper():<EOL><INDENT>content_type = self.HTML<EOL><DEDENT>elif "<STR_LIT>" in content_type.upper():<EOL><INDENT>content_type = self.PLAIN<EOL><DEDENT>for part in msg.walk():<EOL><INDENT>if str(part.get_content_type()) == content_type:<EOL><INDENT>return str(part.get_payload(decode=True))<EOL><DEDENT><DEDENT>
Given an Email.Message object, gets the content-type payload
as specified by @content_type. This is the actual body of the
email.
@Params
msg - Email.Message object to get message content for
content_type - Type of content to get from the email
@Return
String content of the email in the given type