I am fetching data from email by python by get_payload(). I want data line by line to collect a certain line of data. Here is the code
for msg in msgs[::-1]:
for response_part in msg:
if type(response_part) is tuple:
my_msg=email.message_from_bytes((response_part[1]))
for part in my_msg.walk():
#print(part.get_content_type())
if part.get_content_type() == 'text/plain':
if part.get_payload().__contains__('INR')==True:
print("_________________________________________")
print ("subj:", my_msg['subject'])
print ("from:", my_msg['from'])
print ("body:")
#print(part.get_payload())