使用控件: IdSMTP1: TIdSMTP;
 IdMessage1: TIdMessage;当我用下列代码添加邮件
TIDAttachment.Create(IdMessage1.MessageParts,trim(FilePath));系统提示:[DCC Error] Unit1.pas(259): E2003 Undeclared identifier: 'TIDAttachment'请问如何解决,感谢!!

解决方案 »

  1.   

    INDY10添加邮件附件的问题!INDY9添加邮件附件使用如下代码,但是在INDy10里面提示出错!TidAttachment.Create(idMessage1.MessageParts, AttachmentFileName);    这些代码将不能工作在Indy10 ,TIdAttachment是一个抽象基类
    在Indy10 。您不能直接使用它,必须使用一个新的继承类,如TIdAttachmentFile。Uses 
       IdAttachmentFile;TIdAttachmentFile.Create(idMessage1.MessageParts, AttachmentFileName);
      

  2.   

    Delphi 2006中也同样存在这个问题,哎。找个N久终于找到了,在此感谢一下失踪的月亮和楼主。