简体   繁体   English

通过 Python 发送 Outlook 电子邮件时需要收据

[英]Require receipts when sending Outlook email by Python

Simple lines to send Outlook email by Python,通过 Python 发送 Outlook 电子邮件的简单行,

referencing from Send email through Python using Outlook 2016 without opening it 使用 Outlook 2016 通过 Python 发送电子邮件而不打开它

import win32com.client as win32

outlook = win32.Dispatch('outlook.application')
mail = outlook.CreateItem(0)
mail.To = 'contact@sample.com'
mail.Subject = 'Message subject'
mail.Body = 'Message body'

mail.Send()

Is it possible to require Delivery Receipt and Read Receipt when sending an email?发送电子邮件时是否可以要求发送收据和阅读收据? What would be the good way?什么是好方法?

在此处输入图片说明

Sure, use ReadReceiptRequested & OriginatorDeliveryReportRequested property MSDN当然,使用ReadReceiptRequestedOriginatorDeliveryReportRequested 属性 MSDN

Example例子

import win32com.client as win32

outlook = win32.Dispatch('outlook.application')
mail = outlook.CreateItem(0)
mail.To = "0m3r@Email.com"
mail.Subject = 'Message subject'
mail.Body = 'Message body'
# request read receipt
mail.ReadReceiptRequested = True
# request delivery receipt
mail.OriginatorDeliveryReportRequested = True
mail.Send()

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM