Connect throws socket error 11001 exception

Giganews Newsgroups
Subject: Connect throws socket error 11001 exception
Posted by:  Brian Rasmusson (…@XbitXberXry.com)
Date: Thu, 12 Jul 2007

Hi,

I'm trying to send an email using TIdSMTP, but apparently it cannot find my
mail server.. I'm using the Indy version delivered with C++ Builder 2007.

If I use QuickSend like this it works fine:

  SMTP->QuickSend(NULL,
"relay.pair.com","test","…@bitberry.com","…@bitberry.com","test test
test");

If I configure the component like this and call Connect, it gives me the
"socket error 11001: host not found" exception:

  SMTP->Host  = "relay.pair.com";
  SMTP->UseTLS  = utNoTLSSupport;
  SMTP->Port  = 25;

  try
  {
    SMTP->Connect(15000); // timeout in milisec. throws if error.
  }
  catch(Exception &e)
  {
    //
  }

What am I missing?

Thanks,
Brian

Replies