Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #specific #python #UNSEEN #SINCE #T
ADD COMMENT
Topic
Name
8+7 =