tags:

views:

94

answers:

1

I'm trying to design a mailing system (.NET C#).

Messages are stored in database in two tables:

  • message(Message_id, Receiver, Sender, Subject, ...) //message's header

  • message_parts(Message_id, Content_id, Part_type, Content)

So, the content of message is divided into parts (html body, plain text body, sources for html, attachments)

I can't find a way how could i display the message in the WebBrowser control in case when I have html with embedded images. I will have html that references images by content id, i will have images encoded in base64. Now how can I link them and display?

The only ideea that comes to me is building an mht file and open it in the WebBrowser. But besides that i can't figure out how to do this too, the last thing i want is to create files on the local system.

So, the questions are:

  • how can I display a message broken into parts as explained above?
  • how to build an mht file having these parts?
  • maybe it's not a WebBrowser I should use, but some UI control that does the work for me?

Thank you!

A: 

You could create the mht file and set the mimetype to multipart/mine.

Here is a webpage which has some code to create MHT (possibly relying on dlls you need to install separately): http://www.eggheadcafe.com/articles/20040527.asp

Perhaps this might be helpful too: http://msdn.microsoft.com/en-us/library/aa488379(EXCHG.65).aspx

Moron
Thank you a lot! I will have to create temporary files, but it fits my critical requirements!
Pavel