我正在使用下面的代码从不同的主题行获取电子邮件正文,然后我需要在Oracle中运行存储过程
假设我们收到这封带有特定主题行的邮件,我需要在我的Oracle数据库中插入9月9日的价格
RIC Date Price
Atul 9-Sep-19 298.14
这就是我迄今为止所尝试的
import win32com.client
import os
outlook=win32com.client.Dispatch("Outlook.Application").GetNameSpace("MAPI")
inbox=outlook.GetDefaultFolder(6).Folders.Item("MD-GPS") #Inbox default index value is 6
message=inbox.Items
for message2 in message:
subject=message2.Subject
print(subject)
if 'EOD Level Report for ZKB Swisscanto' in subject:
body=message2.body
date=message2.senton.date()
sender=message2.Sender
attachments=message2.Attachments
print(subject)
print(body)
print(sender)
print(attachments.count)
print(date)
目前没有回答
相关问题 更多 >
编程相关推荐