Extract body from MIME message

  • Thread starter Thread starter centur
  • Start date Start date
C

centur

I need to acquire content body of MIME encoded message (as IMessage
object).I want using C# and CDO Interop extract such data
("eJ8+IggVAQaQ..." unicode part).

Here is example of Bodypart (complete original here
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/exchserv/html/backbone_767n.asp)

------ =_NextPart_000_01BAE995.CB66A290
Content-Type: application/ms-tnef
Content-Transfer-Encoding: base64

eJ8+IggVAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy
b3NvZnQgTWFpbC5Ob3RlADEIAQWAAwAOAAAAzAcBABcADQAWAAYAAgAWAQEggAMADgAAAMwHAQAX
---cutted----

------ =_NextPart_000_01BAE995.CB66A290--


I tried to obtain it through CDO.IBodyPart.GetStream() ( I also tried
GetDecodedContentStream, same result) but any attempts to Read() or
ReadText() from ADODB.Stream
throws ExecutionEngineException or NullReference one.
Saving to file works fine but I want to do all operations in-memory
(SaveToFile have only one parameter - path to file - unable to replace
it with any Stream-like object)
I dont sure how to use ADODB.Stream, but according to debug info - it's
opened, position in the begining of the stream, other properties look
correct either. But no luck with read from.

Any ideas or detailed RTFMs (MSDN didn't enlighten about this problem)

PS This message is second part of problem with getting attachments from
MS-TNEF encoded message. I was pointed to OpenPOP Library, but
unfortunately OpenPOP TNEFparser implementation isn't good enough
(maybe only in my case =( ), and now I'm going to extract body and
decode it by hands with some help of OpenPOP TNEFParser.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top