使用python从Outlook访问电子邮件收件人地址 [英] Accessing email recipient addresses from outlook using python

查看:130
本文介绍了使用python从Outlook访问电子邮件收件人地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在python 3.x中使用win32com.client,我能够访问存储在Outlook 2013中的电子邮件.我能够从电子邮件中访问我需要的所有信息,但收件人的电子邮件地址除外电子邮件(收件人,抄送和密件抄送).我可以访问收件人的姓名,但不能访问他们的电子邮件地址.例如,我可以看到已将电子邮件发送到"John Smith",但看不到该电子邮件已发送到"john.smith@gmail.com".

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".

是否可以访问此信息?

推荐答案

而不是读取MailItem.To/CC/BCC属性,而是循环遍历MailItem.Recipients集合中的所有项目并读取Recipient.Address属性.您可能还需要Recipient.Type属性(olTo, olCC, olBCC)和Recipient.Name.

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.

这篇关于使用python从Outlook访问电子邮件收件人地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆