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

Getting the email body using python

$
0
0

I'm quite new at this, but I've been trying to get the email body using python and I've tried almost all of the examples out there and I was able, with:

original = email.message_from_string(response_part[1].decode('utf-8'), policy=policy.default)

         data1 = original.get_body('text/plain')

to get this:

Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64

SGkNCg==

in which the last line is actual my email body encoded with base64 but what I'm trying to do now is to actually get just the last line:

SGkNCg==

any suggestions?


Viewing all articles
Browse latest Browse all 29929


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