|Posted by:||Remy Lebeau (TeamB) (email@example.com)|
|Date:||Fri, 9 Dec 2005|
"Peter Edley" <Pet…@cww.org.uk> wrote in message
> the code i'm using is:
Your code is completely wrong.
Why are you using the ResolveContentType() method? You should not be. It
does not do what you think it does, it is designed for something else
completely unrelated. Get rid of it.
Also, you need to check whether each individual MessagePart object is a Text
object or not. The MessageParts collection can contain Text or Attachments.
If a part is Text, then you can obtain the contents of its Body.
Also, If the MessageParts collection is not empty then there will be nothing
in the main Body property, so you can ignore that altogether.
And lastly, due to the complex nature of MIME-encoded messages, you need to
drill down into the message parts to find the real content, as it may be
several levels down.
If you look in the "borland.public.delphi.internet.winsock" newsgroup on
Borland's newsserver, there is a discussion thread titled "content-type
multipart/mixed insted of text/html" that discusses this topic in more
detail. The discussion started on November 19, and I posted example code on
December 2. The code is in Delphi, so you'll have to translate it to .NET
MIME posted by Peter Edley on Fri, 9 Dec 2005