OnSMTPError event
|
SendMail component.
|
type
|
TSMTPResponseEvent = procedure(Sender: TObject; Code: Integer; const Response: String) of object;
|
|
property OnSMTPError: TSMTPResponseEvent;
|
The OnSMTPError event occurs when the SMTP server returns an error code with response (see OnResponse event). After receiving error code, the SendMail component automatically terminates connection with SMTP server, then triggers the OnSMTPError event.
|
|
For more information about status codes of SMTP protocol see RFC 821.
|
procedure TForm1.SendMail1SMTPError(Sender: TObject;
|
Code: Integer; const Response: string);
|
begin
|
with StatusList do
|
begin
|
Items.Add('ERROR: ' + Response);
|
ItemIndex := Items.Count - 1;
|
end;
|
end;
|
OnResponse and OnAnyError events.
|