I use Microsoft CDO (Collaboration Data Objects) to programmatically read mail from an Outlook mailbox and save attachments. I am trying to do this with Python using Win32 extensions, but examples in any language that uses CDO will be useful.
I'm still here ...
The following Python code will read the last email in my inbox, print the attachment names, and print the message body:
from win32com.client import Dispatch session = Dispatch('MAPI.session') session.Logon('','',0,1,0,0,'exchange.foo.com\nbar'); inbox = session.Inbox message = inbox.Messages.Item(inbox.Messages.Count) for attachment in message.Attachments: print attachment print message.Text session.Logoff()
However, attachment names are such as: "zesjvqeqcb_chart_0". Inside the email source, I see the image source links as follows: <IMG src = "cid: zesjvqeqcb_chart_0">
So, can this CID URL (or something else) be used to retrieve the actual image and save it locally?
source share