outlook = win32.Dispatch('outlook.application')
mail = outlook.CreateItem(0)
mail.SentOnBehalfOfName = 'EMAIL'
mail.To = 'EMAIL'
mail.Subject = 'Message subject'
mail.Body = 'Message body'
mail.HTMLBody = 'HTML Message body' #this field is optional
mail.display(True)
Using the above code I am able to send mails via outlook using Python. It opens a email window on which I can click on Send button to finally send the email.
My question is, can I track if the email was actually sent or someone just closed the outlook window? Just to make sure the code can keep a track of mails sent or not sent.