How do you accsess to a gmail inbox and manage emails using python?
Question: I've done a program to send mails, wich have a numbers code in the subject.
Now I need to write another one to be able to read through all the mail
subjects searching for one specific, and returns the contents of the mail I
was searching for.

Thank you for your help.


Answer: To access your gmail inbox and manage emails you will have to use a module
called "imaplib" Here you have a short example to access your inbox:

    
    
    import imaplib
    
    mail = imaplib.IMAP4_SSL('imap.gmail.com')
    mail.login('youremail@gmail.com', 'yourpassword')
    mail.list()
    # Out: list of "folders" aka labels in gmail.
    mail.select("inbox") # connect to inbox.
    

I'm sure you can continue from here.

