Python 2.7 - Outlook Win32com.client 无法从 .msg 获取发件人的实际电子邮件地址
Python 2.7 - Outlook Win32com.client Can't get senders actual email address from .msg
如何使用 python 中的 win32com.client 模块从 .MSG 文件中获取发件人电子邮件地址?
这是我目前拥有的:
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
for path, dirs, files in os.walk('.'):
for filename in files:
filename_no_ext, ext = os.path.splitext(filename)
if ext.lower() in ['.msg']:
try:
msg = outlook.OpenSharedItem(os.path.join(os.path.abspath(path), filename))
except Exception as x:
print >>sys.stderr, filename
print >>sys.stderr, x
continue
如何使用 python 中的 win32com.client 模块从 .MSG 文件中获取发件人电子邮件地址?
这是我目前拥有的:
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
for path, dirs, files in os.walk('.'):
for filename in files:
filename_no_ext, ext = os.path.splitext(filename)
if ext.lower() in ['.msg']:
try:
msg = outlook.OpenSharedItem(os.path.join(os.path.abspath(path), filename))
except Exception as x:
print >>sys.stderr, filename
print >>sys.stderr, x
continue