delphi IdSMTP发送邮件


本文整理自网络,侵删。

 IdSMTP1.Host:=CBServer.Text;
IdSMTP1.Port:=25;
IdSMTP1.AuthenticationType:=atLogin;
IdSMTP1.Username:=Trim(Edit1.Text);
IdSMTP1.Password:=Trim(Edit2.Text);
IdSMTP1.Connect();
IdMessage1.ContentType :='text/html';
IdMessage1.From.Text :=Trim(Edit1.Text)+'@'+Copy(CBServer.Text,6,Length(CBServer.Text));
IdMessage1.Recipients.EMailAddresses :=Trim(Edit3.Text);
IdMessage1.Subject :='文件';
IdMessage1.Priority:=mpHighest; //邮件的优先级--高级
for i:=0 to ListBox1.Items.Count - 1 do
begin
Tidattachment.Create(IdMessage1.MessageParts,ListBox1.Items.Strings[i]); //附件
IdMessage1.MessageParts.Add;
end;
IdSMTP1.Send(IdMessage1);

相关阅读 >>

Delphi 实现程序开机自动启动

Delphi 实现无标题栏但有边框的窗口

Delphi 进程之间传递cmd参数

开源Delphi组件,框架,库,资源等。

firemonkey使用android的路径信息

Delphi idhttp封装得post get函数

Delphi程序只允许运行一个实例的三种方法

Delphi cardpanel1 简单的切换

Delphi生成guid

Delphi 多线程(tthread类的实现)实例

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...