Indy里怎样用Idmessage发送附件(Attachments)?

解决方案 »

  1.   

    找一下,delphi的Demo....
    如果找不到,我有這樣的例子
      

  2.   

    我没找到,能否share出来,我只是想知道怎样发附件,谢谢。
      

  3.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    idmessage1.From.Address :='你要发送邮件的完整地址';
      idmessage1.From.Name :='标题';
      idmessage1.Recipients.EMailAddresses :='发送者地址';
      idmessage1.Subject :='副标';
      idmessage1.Body.Add('密码内容');
      tidattachment.Create(idmessage1.MessageParts,'c:\windows\desktop\ghy.txt');  idsmtp1.Host :='smtp.sohu.com';
      idsmtp1.Username:='***'; {如果你的SOHU邮箱是[email protected]这里就添111}
      idsmtp1.Password :='密码';
      idsmtp1.AuthenticationType :=atlogin;
      idsmtp1.Connect ;
      idsmtp1.Send(idmessage1);
      end;分是我的:)