Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29755

How can I decode email contents that are differently "Content-Transfer-Encoding" encoded?

$
0
0

I'm reading emails with imaplib, and found out that some email contents are encoded base64, and some 7bits.

I tried to decode it with 'Content-Transfer-Encoding' value.

But even more, some have 'Content-Transfer-Encoding' header in message object, whereas some have it in message.get_payload()[0].

I can deal with these some cases, but I think there can be more cases that I haven't found.

Is there any better way to decode email contents, no matter how they are encoded?

Thanks :)


Viewing all articles
Browse latest Browse all 29755

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>