[英]Create and send an e-mail with a scheduled time in outlook with python
I would like to create and send an e-mail with a scheduled time (with delay delivery in the options tab) in outlook with python.我想在 outlook 和 python 中创建并发送具有预定时间的电子邮件(在选项选项卡中延迟发送)。 The script below simply sends an email without a delivery time option:
下面的脚本只是发送一个 email 没有交货时间选项:
import win32com.client as win32
def Emailer(text, subject, recipient):
outlook = win32.Dispatch('outlook.application')
mail = outlook.CreateItem(0)
mail.To = recipient
mail.Subject = subject
mail.HtmlBody = text
mail.send
I added the line below, as an example, it worked.作为示例,我添加了下面的行,它起作用了。
mail.DeferredDeliveryTime = datetime.datetime(2022, 4, 1, 17, 29, 25, tzinfo=datetime.timezone.utc)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.