[python-win32] Pywin32 outlook email organizer

Joni Orponen j.orponen at 4teamwork.ch
Wed Jan 31 12:45:20 EST 2018


On Wed, Jan 31, 2018 at 5:50 PM, Samantha Mait <Samantha.Mait at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20180131/fd9e4fa7/attachment.html>


More information about the python-win32 mailing list