Re: [tmail2000] Bugs in TMailMessage2000.
"Zhentao Song"
z.song@... schrieb am 07.09.05 15:24:14:
2. A Mail has Plaintext Body, and contains a THML File as Attachment. I have
Problem with such Mail, if I put this Mail in TMailMessage2000,
then the contents of the Attachment is put in the Property TextHTML, and show in
the HTML Body, there is not Attachment in TMailMessage2000.
Mail2000's current implementation
treats the first text/html part found in the message as TextHTML.
And this is your expectation:
If Message.ContentType = 'text/html' treat the first text/html part as
TextHTML.
If Message.ContentType = 'multipart/alternative' treat the first text/html
part in the children of the message part.
##WARNING ### I have never tested this code .#####
if (FTextHTMLPart = nil) and (Info = _T_H) then
begin
if Part.Decode and (Part.Decoded.Size 0) then
begin
if (Part = Self) or ((Part.Parent=Self) and (Self.GetAttachInfo =
_M_A)) then begin ---Something like this !
FTextHTMLPart := Part;
GetMem(Buffer, Part.FDecoded.Size+1);
StrLCopy(Buffer, Part.FDecoded.Memory, Part.FDecoded.Size);
Buffer[Part.FDecoded.Size] := #0;
FTextHTML.SetText(Buffer);
FreeMem(Buffer);
end;
Result := True;
end;
end;