简体   繁体   中英

Detect sending (or not) of Outlook mail sent by Python (with win32com)

My overall goal is to send some generated emails via Outlook from Python/win32com ( unfortunately this part isn't really feasible to change ) and the method here works very well:

How do I generate and open an Outlook email with Python (but do not send)

I'm using it to generate the emails, with them showing up via the Outlook UI and then I either send them (possibly with editing) or cancel them (ie do not send).

However there is one limitation and from Googling and tinkering in Python I cannot see what I should do.

I would like to be able to programmatically log whether the displayed email was actually sent or cancelled.

I cannot see any value returned from mail.Display(True) and the mail object itself doesn't show any attributes that look like they indicate what happened.

Is there a way to do this?

MailItem对象将在发送时触发MailItem.Send事件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM