在 D2010 上使用 Indy tiburon 的最新快照。一个非常简单的项目,例如:
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;
在 Outlook、The bat!、OE、yahoo 等中一切正常……但在 Thunderbird 中,附件未显示。在 Thunderbird 中查看消息的来源,附件就在那里。我可以发现 indy 和其他客户端发送的消息之间的唯一区别是 Indy 消息具有以下顺序:
Content-Type: multipart/mixed; boundary="Z\=_7oeC98yIhktvxiwiDTVyhv9R9gwkwT1"
MIME-Version: 1.0
而任何其他客户都有订单:
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="Z\=_7oeC98yIhktvxiwiDTVyhv9R9gwkwT1"
不知道这是否是问题的根源,但如果是这样:这是 Thunderbird 上的错误还是 indy 的问题,它“畸形”了消息的标题?这个订单有问题吗?这有关系吗?