Re: TIdSMTP - reinitialize ?

Giganews Newsgroups
Subject: Re: TIdSMTP - reinitialize ?
Posted by:  Dmitry Mikhilov (d…@fromru.com)
Date: Sun, 6 Jul 2003

Try using wininet.lib (just add it to your project) and function:

bool TestInternet(bool autoconnect)
{
DWORD flags;
return InternetGetConnectedState(&flags,0) || autoconnect &&
InternetAutodial( INTERNET_AUTODIAL_FORCE_UNATTENDED,0);
}

Returns true if connection is (was previously) established. When all the job
is done, just perform InternetAutodialHangup(0)
But this function will break the connection only if default connection is
specified in your IE settings.

HTH,
    Dmitry

"Andrew Jameson" <conta…@softspotsoftware.com> wrote:
news:B8B5AD1D0D76E240conta…@softspotsoftware.com...
> If I post mail when not connected, I get the dial-up dialog ... just what
I
> want ... but if I cancel, I then get a socket error 11001 ... that makes
> perfect sense too ... but if I try to post again, I no longer get the
> dial-up dialog and immediately get the 11001 error.  Is there way to
> reinitialize so that it'll always bring up the dial-up dialog if not
> connected ?

Replies

In response to

TIdSMTP - reinitialize ? posted by Andrew Jameson on Sun, 6 Jul 2003