下面代码是网友的,面孔很熟悉!但我改装D2005后发现不能用了!tidattachment.Create方法的参数个数都不同了。同助如何绑附件呀!:)))
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;