why does my D2009 exe produce emails with attachments named ATTnnnnn.DAT

后端 未结 5 997
忘掉有多难
忘掉有多难 2021-01-05 07:47

Why does my D2009 exe produce emails with attachments named ATTnnnnn.DAT when the same source code compiled in D2007 produces emails with attachments correctly named with th

5条回答
  •  一向
    一向 (楼主)
    2021-01-05 08:30

    I have found the problem - please see the adug.com.au mailing list for exact details of the solution, but in summary -- the version of Indy that comes with D2009 (version 10.2.5) has 2 errors in the IdMessageClient.pas unit in two lines that set the name= and filename= in the attachment part processing (one line number is 1222 from memory and the other is a few lines earlier; sorry I am at home now; I fixed things this evening at work). The lack of these semi-colons causes the attachment header to be badly formed and Outlook generates a name of its own for the attachment.

    The fix is to output a semi-colon ( ; ) before outputting the name= or filename= tokens. Then Indy needs to be rebuilt.

    I compared the D2007 version of Indy (10.1.5) and can see it always puts the semi-colon at the end of the Content-Type line thus avoiding the problem that has crept into the version included with D2009.

提交回复
热议问题