(mail)
Get the email message content.

    Args:
        mail (email.message.Message): The email message.

    Returns:
        :obj:`bytes` or :obj:`str`: The contents, with headers, of the email
        message. It returns `bytes`.

    Raises:
        email.errors.MessageError:  if mail is neither *bytes* nor *str*.
Get the email message content.
Get the email message content .
def mail_content(mail):
    # type: (Email) -> AnyStr
    """Get the email message content.

    Args:
        mail (email.message.Message): The email message.

    Returns:
        :obj:`bytes` or :obj:`str`: The contents, with headers, of the email
        message. It returns `bytes`.

    Raises:
        email.errors.MessageError:  if mail is neither *bytes* nor *str*.

    """
    if not isinstance(mail, email.message.Message):
        raise email.errors.MessageError(
            "mail '{}' is not a email.message.Message.".format(repr(mail)))
    try:
        return mail.as_bytes()
    except UnicodeEncodeError:
        return mail.as_string()
def mail_content ( mail ) : # type: (Email) -> AnyStr if not isinstance ( mail , email . message . Message ) : raise email . errors . MessageError ( "mail '{}' is not a email.message.Message." . format ( repr ( mail ) ) ) try : return mail . as_bytes ( ) except UnicodeEncodeError : return mail . as_string ( )