Delphi6中如何将指定文本文件通过Mail发出去?请高手帮忙! Delphi6中我要把test.txt的这个文件用Mail发出去,怎么写代码,请高手指教。一定给高分。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 INDY发送需要认证邮件的代码procedure TForm1.Button1Click(Sender: TObject);beginidmessage1.From.Address :='你要发送邮件的完整地址'; idmessage1.From.Name :='标题'; idmessage1.Recipients.EMailAddresses :='发送者地址'; idmessage1.Subject :='副标'; idmessage1.Body.Add('密码内容'); tidattachment.Create(idmessage1.MessageParts,'c:\windows\desktop\ghy.txt');您的附件就是你的test.txt文件 idsmtp1.Host :='smtp.sohu.com'; idsmtp1.Username:='***'; {如果你的SOHU邮箱是[email protected]这里就添111} idsmtp1.Password :='密码'; idsmtp1.AuthenticationType :=atlogin; idsmtp1.Connect ; idsmtp1.Send(idmessage1); end;祝:身体健康,提前完工:) idmessage1,tidattachment,idsmtp1是什么控件? 最近在写控件,谁能介绍一些控件继承,重载相关的控件编程文档来看下。谢谢了 怎么得么第一,第二,第三个括号的内容 为什么是先inherited再赋值?高手帮忙看看 怎样判断数据库服务器中有指定的临时表?如果有,临时表怎样删除? DBGrid不要让它自个儿排序行不行? 有个问题大家来帮助一下吧,up有分 NMSMTP控件发EMAIL问题(SMTP服务器需要身份验证) 修改TQuery查询的结果,快进来看看! sql+delphi问题,很急 还有人吗?偶用问题 月工资3500的三家企业,如何选择! 高分求解!!三层结构,提示“无效的被呼叫方”,在线等候。。。
begin
idmessage1.From.Address :='你要发送邮件的完整地址';
idmessage1.From.Name :='标题';
idmessage1.Recipients.EMailAddresses :='发送者地址';
idmessage1.Subject :='副标';
idmessage1.Body.Add('密码内容');
tidattachment.Create(idmessage1.MessageParts,'c:\windows\desktop\ghy.txt');您的附件就是你的test.txt文件 idsmtp1.Host :='smtp.sohu.com';
idsmtp1.Username:='***'; {如果你的SOHU邮箱是[email protected]这里就添111}
idsmtp1.Password :='密码';
idsmtp1.AuthenticationType :=atlogin;
idsmtp1.Connect ;
idsmtp1.Send(idmessage1);
end;祝:身体健康,提前完工:)