from imap_tools import MailBox, AND
import re
yahooSmtpServer = "imap.mail.yahoo.com"
client = MailBox(yahooSmtpServer).login('myEmail', 'myPassword', 'INBOX')
for msg in client.fetch(AND(seen=False)):
mail = msg.html
print(mail)
I want t get unseen messages in my mail as soon as they'll appear in my inbox. looping through this code I can always check for unseen messages but it's really troublesome and I don't know how to flag a message as read.
so is there any way I can get unseen messages in my yahoo mail inbox using IMAP-tools? if not... can I do it using another library? Thank you.