简体   繁体   English

如何使用 Z23EEEB4347BDD255DFC6B7EE9A3 从 outlook 中的 MailItem 获取发件人 SMTP email 地址?

[英]How to get sender SMTP email address from MailItem in outlook using python?

I am trying to get the sender email address of MailItem using Python and win32, but whenever Exchange address is found, I am unable to get the SMTP address.我正在尝试使用 Python 和 win32 获取 MailItem 的发件人 email 地址,但是每当找到 Exchange 地址时,我都无法获取 SMTP 地址。 I tried everything available on the net, but it is returning an empty string.我尝试了网上可用的所有内容,但它返回一个空字符串。 Here is the code snippet I'm using:这是我正在使用的代码片段:

if msg.Class == 43:
    if msg.SenderEmailType == 'EX':
      print(msg.Sender.GetExchangeUser().PrimarySmtpAddress)
    else:
      print(msg.SenderEmailAddress)

You can try to read PidTagSenderSmtpAddress MAPI property (DASL name http://schemas.microsoft.com/mapi/proptag/0x5D01001F ) using MailItem.PropertyAccessor.GetProperty - take a look at the message with OutlookSpy (click IMessage button) or MFCMAPI .您可以尝试使用MailItem.PropertyAccessor.GetProperty读取PidTagSenderSmtpAddress MAPI 属性(DASL 名称http://schemas.microsoft.com/mapi/proptag/0x5D01001F ) - 使用OutlookSpy (单击 IMessage 按钮)或MFCMAPI查看消息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用python阅读Outlook 365电子邮件并获取发件人电子邮件(交换或SMTP) - Read outlook 365 email using python and get sender email (exchange or SMTP) 使用 python 从发件人电子邮件地址在 Outlook 中创建规则 - Use python to create rule in Outlook from sender Email address 使用 win32 从 Python 中的 Outlook Exchange 中提取发件人的电子邮件地址 - Extract sender's email address from Outlook Exchange in Python using win32 如何使用Gmail Python API获取电子邮件发件人的电子邮件地址 - How to get the email-address of the sender of an email using Gmail Python API Python 自动化 Outlook 电子邮件:更改发件人或默认回复地址 - Python automated Outlook email: change sender or default reply-to address 使用 Python IMAP 获取发件人电子邮件地址 - Get sender email address with Python IMAP 如何使用python获取收到的Outlook邮件的日期和时间并检查来自特定发件人的正文 - How to get date & time of received outlook mail and check body from particular sender using python 如何在python电子邮件脚本中在发件人地址之前添加发件人姓名 - How to add sender name before sender address in python email script 使用 Python 从 Outlook 获取 Email 列表 - Get Email list from Outlook using Python Django-python email 表单不通过 gmail Z787C75233B93AA5EZD45 转发发件人的 email 地址 - Django-python email form is not forwarding sender's email address via gmail smtp
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM