python with ofllok win32.client问题
我正在尝试使用win32.clationt导入的python 3.9中的“收件人” Outlook对象,但只能访问“收件人”。收件人没有“地址”属性,但是“收件人”确实可以根据需要从发件箱获取收件人的电子邮件地址。任何人都可以处理或其他推荐的图书馆来实现这一目标吗?存在收件人对象,我只是无法访问它。
import win32com.client as win32
import os
from datetime import datetime, timedelta
messageobjectlist = []
reciplist = []
messages = outbox.Items
received_dt = datetime.now() - timedelta(days=1)
received_dt = received_dt.strftime('%m/%d/%Y %H:%M %p')
messages = messages.Restrict("[ReceivedTime] >= '" + received_dt + "'")
for each in messages:
if each.Class == 43:
messageobjectlist.append(each)
for x in messageobjectlist:
reciplist.append(x.Recipients) #this is the problem, if i try to grab addresses from this, "recipients" does not have the property, only "recipient" does, but python tells me "recipient" is unknown
print(x)
for y in reciplist:
print(y)
#this is the output from the code above, unknown coms instead of desired addresses
back up code
RE: Group Kickoff
RE: Thank You
RE: spac-research_1652212493196.csv
Outlook Programmatic Permissions
RE: (cmts 5.10.22)
RE: - Fully Executed LOE
RE: - Fully Executed LOE
RE: - Fully Executed LOE
FW: logo
RE: Expense report
RE: Expenses - Moving & November Visit
FW: Thank You
RE: - Advisory (May 2022) (cmts 5.10.22)
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
i am trying to access the "recipient" outlook object in python 3.9 using win32.clients import, but can only access "recipients". Recipients does not have an "address" property, but "recipient" does to get the recipients email address from an outbox as desired. anyone have a work around or other recommended libraries to accomplish this? the recipient object exists, i just cant access it learn.microsoft.com/en-us/office/vba/api/outlook.recipient
import win32com.client as win32
import os
from datetime import datetime, timedelta
messageobjectlist = []
reciplist = []
messages = outbox.Items
received_dt = datetime.now() - timedelta(days=1)
received_dt = received_dt.strftime('%m/%d/%Y %H:%M %p')
messages = messages.Restrict("[ReceivedTime] >= '" + received_dt + "'")
for each in messages:
if each.Class == 43:
messageobjectlist.append(each)
for x in messageobjectlist:
reciplist.append(x.Recipients) #this is the problem, if i try to grab addresses from this, "recipients" does not have the property, only "recipient" does, but python tells me "recipient" is unknown
print(x)
for y in reciplist:
print(y)
#this is the output from the code above, unknown coms instead of desired addresses
back up code
RE: Group Kickoff
RE: Thank You
RE: spac-research_1652212493196.csv
Outlook Programmatic Permissions
RE: (cmts 5.10.22)
RE: - Fully Executed LOE
RE: - Fully Executed LOE
RE: - Fully Executed LOE
FW: logo
RE: Expense report
RE: Expenses - Moving & November Visit
FW: Thank You
RE: - Advisory (May 2022) (cmts 5.10.22)
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
<COMObject <unknown>>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论