Search
 
SCRIPT & CODE EXAMPLE
 

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()
Comment

PREVIOUS NEXT
Code Example
Python :: add option in python script 
Python :: foreignkey as users from a user group django 
Python :: gpt-3 tokenizer python3 
Python :: pydub play audio 
Python :: python line break inside string 
Python :: python for continue 
Python :: python replace n with actual new line 
Python :: skip to next iteration python 
Python :: how to hide ticks marks in matplotlib 
Python :: Shapes (None, 1) and (None, 5) are incompatible 
Python :: tkinter include svg in script 
Python :: pyhton image resize 
Python :: python .findall 
Python :: code coverage pytest as html 
Python :: how to plot kmeans centroids 
Python :: read an excel file 
Python :: check django version windows 
Python :: fernet generate key from password 
Python :: create python executable 
Python :: strip in split python 
Python :: python function docstring 
Python :: creating django app 
Python :: Python3 seconds to datetime 
Python :: check if number is prime python 
Python :: IQR to remove outlier 
Python :: split path in list of directories 
Python :: convert list of lists to pandas dataframe 
Python :: break line in string python 
Python :: get number in string python 
Python :: abstract class python 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =