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!

H.B.
  • 166,899
  • 29
  • 327
  • 400
Pavel
  • 11
  • 2
  • Check out http://stackoverflow.com/questions/274315/c-webbrowser-html-with-references-to-scripts-and-images for some insight – Mikael Svenson Feb 12 '10 at 07:26

1 Answers1

1

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

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

SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173
  • Thank you a lot! I will have to create temporary files, but it fits my critical requirements! – Pavel Feb 12 '10 at 09:03