全部博文(788)
分类:
2008-10-28 10:00:15
IdSMTP1.AuthenticationType := atNone;
IdSMTP1.Connect;
try if
IdSMTP1.AuthSchemesSupported.IndexOf('LOGIN')>-1 then
begin
IdSMTP1.AuthenticationType := atLogin;
IdSMTP1.Authenticate;
end;
IdSMTP1.Send(IdMessage1);
finally
IdSMTP1.Disconnect;
end;
顶.
procedure TForm1.SendEmail(EAddress: String;SContent:string); //發 Mail
begin
try
IdSMTP1.Host:='192.168.30.13';//smtp Server KSMAIL03 '192.168.30.13'
IdSMTP1.Port:=25; //SMTP 端口
IdSMTP1.Username:='';
IdSMTP1.Password:='';
IdSMTP1.Connect();
except
exit;
end;
try
IdMessage1.Body.Clear;
IdMessage1.Body.Add(SContent); //Content
IdMessage1.From.Text:='WebApps@coretronic.com.cn'; //From
IdMessage1.Recipients.EMailAddresses:=Trim(EAddress);
IdMessage1.Subject:='未刷卡記錄通知'; //Title
IdSMTP1.Send(IdMessage1);
finally
IdSMTP1.Disconnect;
end;
end;
IdSMTP