sendmail OnProgress event
Return to Introduction  Previous page  Next page
Applies to
acSendMail, acHTTP and acAutoUpgrader components (but with different parameters).  

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

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 acSendMail 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.acSendMail1Progress(Sender: TObject; MessageSize,  
  BytesSent: Integer; PercentsDone: Byte);  
begin  
  ProgressBar1.Position := PercentsDone;  
end;  

See also
OnSuccess event.