Open tom634 opened 1 year ago
to get the body of an email you need to use:
await imap_client.uid('fetch', str(uid), 'BODY.PEEK[]')
https://github.com/bamthomas/aioimaplib/blob/master/example/imap_fetch.py
In this example they used some regex expressions to first extract the UID, and then use it in the above code.
after that you'd still need some manipulations to extract what you need
In the documentation I couldn't find example for printing mail content. I want to print e-mail content. I am using part of the code from documentation:
this code works, but how to read last e-mail content? My example response for line:
print((await imap_client.uid('fetch', '1:*', 'FLAGS')))
is:and for line:
print((await imap_client.wait_server_push()))
is:[b'1 RECENT', b'33 EXISTS']
I am using outlook mail service.