sendmail OnSMTPError event
Return to Introduction  Previous page  Next page
Applies to
acSendMail component.  

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

Description
The OnSMTPError event occurs when the SMTP server returns an error code with response (see OnResponse event). After receiving error code, the acSendMail component automatically terminates connection with SMTP server, then triggers the OnSMTPError event.  
 
For more information about status codes of SMTP protocol see RFC 821.  

Example
procedure TForm1.acSendMail1SMTPError(Sender: TObject;  
  Code: Integer; const Response: string);  
begin  
  with StatusList do  
   begin  
    Items.Add('ERROR: ' + Response);  
    ItemIndex := Items.Count - 1;  
   end;  
end;  

See also
OnResponse and OnAnyError events.