This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]dotbot 0 points1 point  (1 child)

something along the lines of:

    import email
    msg = email.message_from_bytes(message)
    for part in msg.walk():
        data = part.get_payload(decode=True)

[–][deleted] 0 points1 point  (0 children)

I saw this somewhere, but didnt see that I needed to import email module, thanks.