I've a simply python script which basically tries to fetch all the email from a gmail account with the following - not great at all - code:
conn = imaplib.IMAP4_SSL('imap.googlemail.com')
conn.login(g_email, g_pass)
conn.select()
for i in range(1, highest_id_number):
msg = conn.uid('fetch', str(i), '(RFC822)')[1][0]
if msg:
do_something_with_the_content
It turned out, that for some reason it fetches only the incoming emails, but not the outgoings.
How can I fetch outgoing email as well via imap?
Python: 2.7.18
Thank You.