TNEF again. Attachment extraction with C Sharp

C

centur

I have a service, which acquire IMessage (CDO Interop) object from
datasource (binary restored eml (RFC822) message from SQL database).
And due to ms-tnef format of message - i can't extract attachments from
it. Is there any example how I should parse TNEF part
(I iterated over BodyParts, and found IBodyPart object with
application/ms-tnef as ContentMediaType. Unfortunately,
IBodyPart.SaveToFile() saves only complete object with formatting, but
I need only attachment, even without name, just attachment body as
array of bytes or string). I dig a bit to
IBodyPart.GetDecodedContentStream but also not sure what I should do
with IStream

I googled a lot, but everything (solutions, that i can code, not tools
that can extract attachments for me) pointed me to OpenTnefStreamEx -
but this is the part of MAPI, and I have no access (dedicated service)
to any Exchange server instance. And I cant interop mapi32.dll (with
TlbImp, - not valid COM error)
If I missed any other way to extract attach from TNEF stream - plz
point on it.

PS: Sorry for my weak English and messed explanation.

With best regards.
 

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

Top