我正在尝试创建一个脚本,将每天上午 8:00 起所有 Outlook 发送的项目转发到专用收件箱。
该邮件必须保存在 Outlook 的已发送邮件文件夹中。
目前我拥有今天的所有电子邮件,但脚本的转发部分不起作用(我没有任何错误消息)
编辑 1:感谢吉米的限制想法!
import win32com.client as win32
outlook = win32.Dispatch("Outlook.Application").GetNamespace("MAPI")
outbox = outlook.GetDefaultFolder(6)
messages = messages = outbox.Items.restrict("[SentOn] > '5/31/2017 08:00 AM'")
for message in messages:
NewMsg = message.Forward()
NewMsg.To = "[email protected] /cdn-cgi/l/email-protection"
已完成:有兴趣的可以在下面找到解决方案
import win32com.client as win32
outlook = win32.Dispatch("Outlook.Application").GetNamespace("MAPI")
outbox = outlook.GetDefaultFolder(5)
messages = outbox.Items.restrict("[SentOn] > '5/30/2017 08:00 AM'")
for message in messages:
NewMsg = message.Forward()
NewMsg.Body = message.Body
NewMsg.Subject = message.Subject
NewMsg.To = "[email protected] /cdn-cgi/l/email-protection"
NewMsg.Send()
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)