Answers for "specific mail.search python UNSEEN SINCE T"

0

specific mail.search python UNSEEN SINCE T

import imaplib,time
 T=time.time()
 M=imaplib.IMAP4_SSL("imap.gmail.com")
 M.login(user,psw)
 M.select() 
 typ, data = M.search(None, 'UNSEEN SINCE T')
 for num in string.split(data[0]):
    try :
       typ, data=M.fetch(num,'(RFC822)')
       msg=email.message_from_string(data[0][1])
       print msg["From"]
       print msg["Subject"]  
       print msg["Date"]  
   except Exception,e:
      print "hello world"
M.close()
M.logout()
Posted by: Guest on November-03-2020

Code answers related to "specific mail.search python UNSEEN SINCE T"

Python Answers by Framework

Browse Popular Code Answers by Language