首页 > 解决方案 > 从outlook邮件中提取抄送列表完整邮件地址

问题描述

我可以 cc = message.CC用来显示邮件项目的 Carbon 副本名称列表。然而,它们只是名称。如何显示 cc 列表的完整邮件地址?

对于发件人的邮件地址,我可以message.sender.GetExchangeUser().PrimarySmtpAddress用来获取。但是 message.CC 不能使用它,因为输出数据类型是“str”。message.sender 输出数据类型是win32com.client.CDispatch.

标签: python-3.xoutlook

解决方案


遍历MailItem.Recipients集合,检查带有Recipient.Type == olCC. 使用Recipeint.AddressEntry属性来检索相应的AddressEntry对象。检查是否AddressEntry.Type == "EX"。如果是,使用AddressEntry.GetExchangeUser().PrimarySmtpAddress,否则使用AddressEntry.Address


推荐阅读