I am trying to reply to emails with a keyword in the subject but I need to do it all through outlook. My current code works decently but it would be better if it could reply directly instead of creating a new message.
Hopefully this is the right place to ask this :)
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
o = win32com.client.Dispatch("Outlook.Application")
inbox = outlook.GetDefaultFolder(6)
def check_mail():
global message
messages = inbox.Items
message = messages.GetLast()
if (message.subject.find('@Bot') != -1 and message.unread and whtlist.find(message.SenderName)!= -1 ):
return 1
else:
return 0
def Read_mail():
global message
global ACTIVE
body_content = message.body
print(bcolors.WARNING