//Verifica se a internet esta conectada function IsConnectedToInternet: Boolean; var
dwConnectionTypes: Integer; begin try
dwConnectionTypes := INTERNET_CONNECTION_MODEM +
INTERNET_CONNECTION_LAN +
INTERNET_CONNECTION_PROXY; if InternetGetConnectedState(@dwConnectionTypes, 0) then
Result := true else
Result := false; except
Result := false; end; end;
Verificação
//verifico se esta conectado se estiver mando email confirmando a exclusao if IsConnectedToInternet = True then begin
IdMessage.Recipients.EMailAddresses := 'cleyton@acabit.com.br';
IdMessage.Subject := 'Backup Sucesso Base, AQ Original';
IdMessage.Body := mmMensagem.Lines;