On Wed, Jan 31, 2018 at 5:50 PM, Samantha Mait <samantha.m...@spacex.com> wrote:
> I am reaching out as I am trying to use the pywin32 package for python 2.7 > to automate sending an outlook calendar invite. The package is awesome and > is able to do everything I would like except for one piece. I am trying to > send the email from a separate email address. Is there any way that I can > do this? > > > > Ideally, I would like the email to be able to generate the script on my > computer, but have the sender be someone else like you can do in python’s > email package via sendmail(from_addresss, [to_address], msg.as_string()). > Microsoft provides a COM interface for Outlook. https://msdn.microsoft.com/en-us/library/office/aa220082 https://msdn.microsoft.com/en-us/library/office/dn320330 Calling CreateItem on the COM dispatch returns you a MailItem, for which you can set the Sender. This might get you there in regards to creating and sending email. I'm not fully certain on how the calendar invites actually work in Outlook, but if there is a need to hook deeper into the (potential) backing Exchange server, Microsoft provides MAPI for that. https://msdn.microsoft.com/en-us/library/office/cc815424 https://msdn.microsoft.com/en-us/library/office/cc765775 -- Joni Orponen
_______________________________________________ python-win32 mailing list python-win32@python.org https://mail.python.org/mailman/listinfo/python-win32