如何利用NMSMTP控件发送电子邮件? 请老大们给出详细的代码示范如果有更好的控件,请指教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 SMTP: TIdSMTP;var AMsg :TIdMessage; str:string;begin AMsg :=TIdMessage.Create(self); with AMsg do begin Body.Text :=str; From.Text :='[email protected]'; Recipients.EMailAddresses := '[email protected]'; Subject := '你好';//标题 Priority := TIdMessagePriority(1);//优先级 CCList.EMailAddresses := '';//抄送 BccList.EMailAddresses := '';//暗抄 ReceiptRecipient.Text := '[email protected]';//如果需要验证身份的邮件服务器需要Form.text和ReceiptRecipient.Text 一样。 end; SMTP.AuthenticationType := atLogin;//这段为设置邮件发送需要身份验证 SMTP.UserID := '1222';//用户名 SMTP.Password := '1234'; SMTP.Host := 'smtp.etang.com'; //发送邮件服务器的地址 SMTP.Port := 25; //发送邮件服务器的端口 //开始发送。 SMTP.Connect; try SMTP.Send(AMsg); finally SMTP.Disconnect; end; AMsg.Free(); str:='';end; 出现提示:Constant expression expected 是什么原因 谁有 介绍DrawCell 事件的 delphi电子书? 求助网络监听程序执行时总是提示“Access Violation at address……”??? 如何在oracle数据库中修改相同记录的数据 提问,怎么样简历这么一个表结构,清说说意见 简单问题~ Delphi7中的TActionToolBar的中文显示问题。急! bpl 问题 Delphi中有没有直接把十进制转换为十六进制的函数? 新手求教:工程中用到的*.bpl如何编译入EXE文件中一块发布 简单问题,快来拿分 关于图片的 显示 在线!
AMsg :TIdMessage;
str:string;
begin
AMsg :=TIdMessage.Create(self);
with AMsg do
begin
Body.Text :=str;
From.Text :='[email protected]';
Recipients.EMailAddresses := '[email protected]';
Subject := '你好';//标题
Priority := TIdMessagePriority(1);//优先级
CCList.EMailAddresses := '';//抄送
BccList.EMailAddresses := '';//暗抄
ReceiptRecipient.Text := '[email protected]';//如果需要验证身份的邮件服务器需要Form.text和ReceiptRecipient.Text 一样。
end; SMTP.AuthenticationType := atLogin;//这段为设置邮件发送需要身份验证
SMTP.UserID := '1222';//用户名
SMTP.Password := '1234'; SMTP.Host := 'smtp.etang.com'; //发送邮件服务器的地址
SMTP.Port := 25; //发送邮件服务器的端口
//开始发送。
SMTP.Connect;
try
SMTP.Send(AMsg);
finally
SMTP.Disconnect;
end;
AMsg.Free();
str:='';
end;