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编写的一款锁屏小工具

Delphi savelog 方便的记录日志

Delphi 只限制到4位小数级别

Delphi 比较两个位图是否相同

Delphi 获取邮箱中的用户名

cnwizards cnpack ide 专家包

Delphi tchart分析报告

Delphi 从文件中读取图像类型

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



打赏

取消

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

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

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

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

评论

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