views:

12

answers:

0

I have an Outlook email (in HTML format) that's been saved as a draft. I want to programmatically extract the embedded images (not the attachments - that's easy!), save them somewhere, and then reconstruct the emails programatically for sending via a System.Net.Mail.SmtpClient.

I can get at the HTML easily enough. I can also extract the embedded images and save them in the file system (using the attachments of type OlAttachmentType.olByValue)

However what I'm struggling with is reconstructing the email later on, so that I can send it programmatically.

I've had a look at the HTML Outlook generates, and there's stuff like:

<img width=800 height=600 id="Picture_x0020_2"
src="cid:[email protected]" alt=Sunset.jpg>

in it.. I've tried parsing the HTML and replacing the src tag with a reference to the image file from the file system, but it's not coming back as the original size it was copied in as.

It's one of those things that's just turning out to be a major hassle, so I'd appreciate any clues.