【发布时间】:2021-03-14 11:11:02
【问题描述】:
我正在尝试使用 Python 和 win32 获取 MailItem 的发件人电子邮件地址,但无论何时找到 Exchange 地址,我都无法获取 SMTP 地址。我尝试了网上所有可用的东西,但它返回一个空字符串。这是我正在使用的代码 sn-p:
if msg.Class == 43:
if msg.SenderEmailType == 'EX':
print(msg.Sender.GetExchangeUser().PrimarySmtpAddress)
else:
print(msg.SenderEmailAddress)
【问题讨论】:
标签: python email outlook smtp win32com