Have a bit of a problem and hoping you can help me
What i am trying to do
- Connect to gmail Via Imap
- Loop through a list of subjects to search for
- Select the id and go and download the attachment
- got it working for 1 but when i go to run the loop through the List(searchlist)
I am getting an error
is the imaplib able to do this
try:
for i in range(len(searchlist)):
#print(str(searchlist[i]))
print(str(searchlist[i]))
imapSession.select('Inbox')
typ, data = imapSession.search(None, str(searchlist[i]))
print(data)
if typ != 'OK':
print('Error searching Inbox.')
raise
I am not getting anything back from the print(data)
thanks in advance for any help!!