sendmail OnHostUnreachable event
Return to Introduction  Previous page  Next page
Applies to
acSendMail, acHTTP and acAutoUpgrader components.  

Declaration
property OnHostUnrachable: TNotifyEvent;  

Description
The OnHostUnreachable event occurs if the acSendMail can not establish connection to SMTP server, specified in SMTPHost property. Possible reasons of this problem is:  
1.User currently not connected to the Internet;  
2.Hostname is unknown (check spelling of domain name in SMTPHost property);  
3.Invalid SMTP port specified (check the number of SMTP port in SMTPPort property);  
4.Remote server is down (disconnected from Internet).  

Example
Delphi:
procedure TForm1.acSendMail1HostUnreachable(Sender: TObject);  
begin  
  Application.MessageBox(PChar('Specified SMTP server is unreachable.'#13#10#10'Please check your Internet connection'#13#10'or specify another SMTP host or/and port.'),  
                         PChar(Application.Title),  
                         MB_OK or MB_ICONSTOP);  
end;  
 
C++ Builder:
void __fastcall TForm1::acSendMail1HostUnreachable(TObject *Sender)  
{  
  AnsiString Msg =   
      "Specified SMTP server is unreachable.\n\n"  
      "Please check your Internet connection\n"  
      "or specify another SMTP host or/and port.";  
  Application->MessageBox(Msg.c_str(),   
                          Application->Title.c_str(),  
                          MB_OK | MB_ICONSTOP);  
}  

See also
SMTPHost and SMTPPort properties;  
OnAnyError event.