Problem with tidMessageParts and html mail

Giganews Newsgroups
Subject: Problem with tidMessageParts and html mail
Posted by:  Helge Schacht (h…@saonet.de)
Date: Thu, 7 Aug 2003

Hello Indy Team,

I use Delphi 6 Prof (german) with indi 9_00_14 (latest dev snapshot) an have
a problem
with TidMessage:

If the message header looks like:

...
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

I can't get the message body.

msg.MessageParts.Count shows "1"
but tidtext(Msg.MessageParts.Items[0]).Body does not
return anything.

Do I do something wrong or is this a bug?

=====
I tried the following but still have problems:

A short workaround...:

Problem: In idMessageCoderMIME.pas nothing will be returned
if there is no MIMEBoundary - String in the eMail AND
LDecoder is set to sothing different than nil.

I changed then marked code (snipplet starting with line 142):

...
  try
    repeat
      if FFirstLine = '' then begin // TODO: Improve this. Not very
efficient
        LLine := ReadLn;
// ==> added following Line for decoding <==
        LDecoder.DecodeToStream(LLine+EOL,ADestStream);
      end else begin
        LLine := FFirstLine;
// ==> added following Line for decoding <==
        LDecoder.DecodeToStream(LLine+EOL,ADestStream);
        FFirstLine := '';    {Do not Localize}
      end;
      if LLine = '.' then begin // Do not use ADELIM since always ends with
. (standard) {Do not Localize}
        VMsgEnd := True;
        Break;
      end;
      // New boundary - end self and create new coder
...

======

This helps getting the mail body, BUT:
If the mail is in html format, I get every Text TWICE (sometimes in one
line, sometimes in two).

What can I do to get the body???

Thanks for Your Help,

greetings, Helge...

Replies