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

拥有回忆 提交于 2019-11-30 20:16:07

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.

I recommend updating to the current Tiburon snapshot (http://indy.fulgan.com/ZIP). The Indy version is 10.5.7 now.

I'm afraid you might just need to trace down into the indy code. Indy has had a number of bugs in the past so this might be the cause. If you trace in you should find it pretty quickly.

Has the IdAttachment.Filename property been set? It's possible that between the Indy versions they changed the way that Filename works.

The recommendations of Richard worked for me. I compared the message sources of a correct attachment and that of Indy. Put the semicolons behind Content-type and Content-disposition (around line 1220 indeed, and it works. Thank you Richard!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!