从不同的电子邮件地址发送 Outlook 约会

Send Outlook Appointment from Different Email Address(从不同的电子邮件地址发送 Outlook 约会)
本文介绍了从不同的电子邮件地址发送 Outlook 约会的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

尝试通过 python 发送 Outlook 日历邀请来自动化日历通知.我想从一个单独的电子邮件地址发送电子邮件.在python的email包中,可以使用sendmail()来指定from_address和to_address;但是,我似乎无法弄清楚如何通过 win32com.client 为 Outlook 邀请执行此操作.

Trying to automate a calendar notification by sending an outlook calendar invite via python. I would like to send the email from a separate email address. In python's email package, you can use sendmail() to specify the from_address and to_address; however, I cannot seem to figure out how to do this for an outlook invitation via win32com.client.

我已经尝试使用 icalendar 包来自动执行此过程,但附加到电子邮件的 ics 文件无法识别".

I had already tried using the icalendar package to automate this process, but the ics file that is attached to the email 'is unrecognized'.

使用 win32com.client,我已经能够在我的邀请中生成我想要的所有内容;但是,我仍然无法弄清楚如何指定发件人.

Using win32com.client, I have been able to generate everything that I want in my invitation; however, I am still unable to figure out how to specify the sender.

import win32com.client as win32
from datetime import datetime
import pytz
tz = pytz.timezone("US/Pacific")

start_time = tz.localize(datetime(2018, 2, 01, 16))
subject = 'The Best Meeting Ever'
duration = 30
location = 'Home'

recipient = 'recipient@example.com'
sender = 'sender@example.com'

outlook = win32.Dispatch('outlook.application')
# CreateItem: 1 -- Outlook Appointment Item
appt = outlook.CreateItem(1) 

# set the parameters of the meeting
appt.Start = start_time
appt.Duration = duration
appt.Location = location
appt.Subject = subject

appt.MeetingStatus = 1 # this enables adding of recipients
appt.Recipients.Add(recipient)
appt.Organizer = sender
appt.ReminderMinutesBeforeStart = 15
appt.ResponseRequested = True
appt.Save()
appt.Send()

当我将电子邮件发送给我的同事时,即使发件人不是我的电子邮件地址,他也会收到来自我的个人电子邮件而不是sender@example.com"的邀请

when I send the email to my coworker, even though the sender is not my email address, he is receiving the invitation from my personal email and not 'sender@example.com'

推荐答案

Outlook/Exchange 不会让您欺骗发件人相关属性 - 会议邀请将作为当前 Outlook 用户发送.

Outlook/Exchange will not let you spoof the sender related properties - the meeting invitation will be sent as the current Outlook user.

这篇关于从不同的电子邮件地址发送 Outlook 约会的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Seasonal Decomposition of Time Series by Loess with Python(Loess 用 Python 对时间序列进行季节性分解)
Resample a time series with the index of another time series(使用另一个时间序列的索引重新采样一个时间序列)
How can I simply calculate the rolling/moving variance of a time series in python?(如何在 python 中简单地计算时间序列的滚动/移动方差?)
How to use Dynamic Time warping with kNN in python(如何在python中使用动态时间扭曲和kNN)
Keras LSTM: a time-series multi-step multi-features forecasting - poor results(Keras LSTM:时间序列多步多特征预测 - 结果不佳)
Python pandas time series interpolation and regularization(Python pandas 时间序列插值和正则化)