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

Declaration
type  
  TSMTPResponseEvent = procedure(Sender: TObject; Code: Integer; const Response: Stringof object;  
 
property OnResponse: TSMTPResponseEvent;  

Description
The OnResponse event occurs every time when component receives the response for SMTP request from server. The response contains the status information (code and optional text) of request.  
 
For more information about status codes of SMTP protocol see RFC 821.  

Example
procedure TForm1.SendMail1Response(Sender: TObject; Code: Integer;  
  const Response: string);  
begin  
  with ListView1 do // status view  
   begin  
    Items.Add(Response);  
    ItemIndex := Items.Count - 1;  
   end;  
end;  

See also
OnSMTPError, OnSuccess and OnProgress events.