def html(message):
"""Returns the html of the message. If the message is multipart search for an
attachment with no filename and with mimetype `text/html` and returns it.
Parameters
----------
message: email.message.Message
Message to decode.
Returns
-------
message_text: str
Returns the html of the message. This method will try return the html
encoded to `utf-8`. If it can't, returns it with its original encoding. If
it can't find the text returns `None`.
Raises
------
TypeError
If the parameter is not an instance of :class:`email.message.Message`.
"""
return Text.decoded(message, ['text/html'])
评论列表
文章目录