Accessing email recipient addresses from outlook using python

元气小坏坏 提交于 2020-02-08 09:40:18

问题


Using win32com.client in python 3.x, I'm able to access email stored in Outlook 2013. I'm able to access all of the information I need from the emails, except for the email address of the recipients of the email (to, cc, and bcc). I'm able to access the names of the recipients, but not their email addresses. For example, I can see that an email was sent to "John Smith", but not that the email was sent to "john.smith@gmail.com".

Is there a way to access this information?


回答1:


Instead of reading the MailItem.To/CC/BCC properties, loop through all items in the MailItem.Recipients collection and read the Recipient.Address property. You might also need Recipient.Type property (olTo, olCC, olBCC) and Recipient.Name.



来源:https://stackoverflow.com/questions/33767792/accessing-email-recipient-addresses-from-outlook-using-python

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!