sendmail OnProgress event
Return to Introduction  Previous page  Next page
Applies to
SendMail component.  

Declaration
type  
  TSMTPProgressEvent = procedure(Sender: TObject; MessageSize, BytesSent: Integer; PercentsDone: Byte) of object;  
 
property OnProgress: TSMTPProgressEvent;  

Description
The OnProgress event occurs every time when the component has successfully sent the part of e-mail message to SMTP server.  
 
Write OnProgress event handler to show the download progress. The SendMail passes to the event handler following parameters:  
ParameterMeaning  
MessageSizetotal size of e-mail message in bytes;  
BytesSentnumber of bytes that already sent to SMTP server;  
PercentsDoneprogress in percents (0%..100%).  

Example
procedure TForm1.SendMail1Progress(Sender: TObject; MessageSize,  
  BytesSent: Integer; PercentsDone: Byte);  
begin  
  ProgressBar1.Position := PercentsDone;  
end;  

See also
OnSuccess event.  
sIU/QH/K+!