var
IdMessage1: TIdMessage;
IdSASLLogin1: TIdSASLLogin;
IdSMTP1: TIdSMTP;
LHlogin: TIdUserPassProvider;
begin
result:=0;
idMessage1:=TIdMessage.Create();
IdSASLLogin1:=TIdSASLLogin.Create();
IdSMTP1:=TIdSMTP.Create();
LHlogin:=TIdUserPassProvider.Create();
with idMessage1 do
begin
ContentType:='text/html';
Body.LoadFromFile(STRfname);
From.Address:=STRfromEMail;
Recipients.EMailAddresses:=STRReEmail;
IDMessage1.Subject:=STRsubject;
end;
with IDSMTP1 do
begin
Host:=STRHost;
port:=INTport;
username:=STRusername;
password:=STRpassword;
LHlogin.Username:=STRuserName;
LHlogin.Password:=STRpassWord;
IDSMTP1.AuthType:=atSASL;
IDSMTP1.SASLMechanisms.Add.SASL:=IdSASLLogin1;
IdSASLLogin1.UserPassProvider:=LHlogin;
try
idsmtp1.Connect;
idsmtp1.Authenticate;
idsmtp1.Send(idMessage1);
idsmtp1.Disconnect;
result:=1;
finally
end;
end;
idMessage1.Free;
IdSASLLogin1.Free;
IdSMTP1.Free;
LHlogin.Free;
end;
文档说明:
相关文档
返回首页 | 关于本站 | | 友情链接 | 广告服务 | 意见建议 | 访客留言 | 本站论坛
Copyright© 2001-2006 ProgramBBS.com All Rights Reserved 版权所有©编程论坛
Email: 吉ICP备05009985号
感谢长春订餐网友情支持