0

I wrote the code to read mails from the server using IMAP in python. I have to run the program at each time to get the new mails. Hence I went through several tutorials 1, 2, where I found that While loop and idle() method can be used for this process. I know how to use while loop for this purpose.

while True:
    mail.select("Inbox")
    ##some data
     time.sleep(120)

Now want to use idle() method for the same purpose. How can do this ?

Stop harming Monica
  • 12,141
  • 1
  • 36
  • 56
  • You'll need a different library. imaplib doesn't support idle. – Max Oct 05 '18 at 13:54
  • Relevant: [idle_example.py](https://github.com/mjs/imapclient/blob/master/examples/idle_example.py) and [Using IMAP IDLE to Wait for Updates](https://www.example-code.com/python/imap_idle.asp) – stovfl Oct 05 '18 at 14:40

0 Answers0