Indy IdSMTP and attachments in Thunderbird

Posted by Lobuno on Stack Overflow See other posts from Stack Overflow or by Lobuno
Published on 2010-03-16T13:57:36Z Indexed on 2010/03/16 17:11 UTC
Read the original article Hit count: 518

Filed under:
|

Hello!

Using the latest snapshot of Indy tiburon on D2010. A very simple project like:

var
  stream: TFileStream; (s is TidSMTP and m is TidMessage)
begin
  s.Connect;
  Stream := TFileStream.Create('c:\Test.zip', fmOpenRead or fmShareExclusive);
  try
    with TIdAttachmentMemory.Create(m.MessageParts, Stream) do
    begin
      ContentType := 'application/x-zip-compressed';
      Name := ExtractFilePath('C:\'); //'
      FileName := 'Test.zip';
    end;
  finally
    FreeAndNil(Stream);
  end;
  s.Send(m);
  s.Disconnect();
end;

Everything works Ok in Outlook, The bat!, OE, yahoo, etc... but in Thunderbird the attachment is not shown. Looking at the source of the message in Thunderbird, the attachment is there. The only difference I can find between messages send by indy and other clients is that Indy messages have this order:

Content-Type: multipart/mixed; boundary="Z\=_7oeC98yIhktvxiwiDTVyhv9R9gwkwT1"
MIME-Version: 1.0

while any other clients have the order:

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="Z\=_7oeC98yIhktvxiwiDTVyhv9R9gwkwT1"

Don't know if THAT is the source of the problem, but if so: is this a bug on Thunderbird or is this a problem with indy which "malforms" the headers of the messages? Is this order a problem? Does that matter anyway?

© Stack Overflow or respective owner

Related posts about delphi

Related posts about indy