python-3.x - 从outlook邮件中提取抄送列表完整邮件地址
问题描述
我可以
cc = message.CC
用来显示邮件项目的 Carbon 副本名称列表。然而,它们只是名称。如何显示 cc 列表的完整邮件地址?
对于发件人的邮件地址,我可以message.sender.GetExchangeUser().PrimarySmtpAddress
用来获取。但是 message.CC 不能使用它,因为输出数据类型是“str”。message.sender 输出数据类型是win32com.client.CDispatch
.
解决方案
遍历MailItem.Recipients
集合,检查带有Recipient.Type == olCC
. 使用Recipeint.AddressEntry
属性来检索相应的AddressEntry
对象。检查是否AddressEntry.Type == "EX"
。如果是,使用AddressEntry.GetExchangeUser().PrimarySmtpAddress
,否则使用AddressEntry.Address
。
推荐阅读
- clojure - 在 Clojure 的嵌套映射中替换多个值
- django - VS Code 在开始调试时显示“发生异常:ModuleNotFoundError”
- outlook-addin - 无法在 Android 和 IOS Outlook 应用程序上找到我的 Outlook 插件
- azure - 如何向使用 azure 函数登录的特定用户发送信号 r 消息?
- javascript - 反应表单未在浏览器中显示
- python - 如何使用 python (pyGithub) 获取 github pull request 所有审阅者
- ios - 如何在第一节iOS中显示标题文本的标题
- python - Python/Selenium:在 Xpath 中插入一个迭代器
- python - 如何使用熊猫比较两列?
- asp.net - 如何修复 checkmarx 扫描反射 XSS 特定客户端