if fileexists(changefileext(paramstr(0), '.log')) then
append(outf)
else
rewrite(outf);
writeln(outf, datetimetostr(now)+'|'+inpt);
closefile(outf);
end;
procedure TForm1.AddMessage(msg:string; color:integer); begin {showing in the memo field progress...} while memo.lines.Count>2000 do memo.lines.Delete(0);
memo.sellength:=0;
memo.selstart:=length(memo.text);
memo.selattributes.Color:=Color;
memo.seltext:=#13#10+DateTimeTostr(now)+' '+msg;
memo.perform($00B7,0,0);
Application.ProcessMessages;
if color<>clRed then log(DateTimeTostr(now)+' '+msg) else log('Error: '+DateTimeTostr(now)+' '+msg);
end;
procedure TForm1.PerformConnection; begin while (not SMTP.connected) do
begin
SetSMTP;
AddMessage('Connecting to SMTP',clBlue);
application.processmessages;
try
SMTP.Connect;
AddMessage('No Errors',clBlue);
except
on e:exception do AddMessage('Error conection: '+e.message,clBlue);
end;
end;
end;
Function TForm1.SendEmail(_to, cc, bcc, Subject, body, attachment:string; HTMLFormat:boolean):boolean; begin PerformConnection;
result:=true;
CleanContext;
try
if (attachment<>'') and (not Fileexists(attachment)) then
begin
AddMessage('Attachment is not ready yet ('+ attachment+') ', clNavy);
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1
Вы не можете начинать темы Вы не можете отвечать на сообщения Вы не можете редактировать свои сообщения Вы не можете удалять свои сообщения Вы не можете добавлять вложения