IdSMPT1->Send() throws exception without message

Giganews Newsgroups
Subject: IdSMPT1->Send() throws exception without message
Posted by:  C.N.Taur (nospam@nowhere.no)
Date: Wed, 24 Feb 2010

Hi,

which kind of error can cause an exception without an error message in the
following code
try
{
    IdSMPT1->Connect();
    try
    {
      IdSMPT1->Send();
    }
    catch (Exception *e)
  {
      Application->MessageBox (e.Message.c_str(), "Error sending mail",
MB_OK);
      fprintf (fp, "Mail not sent. Error='%s'
", e.Message.c_str());
  }
}
catch (Exception *e)
{
      Application->MessageBox (e.Message.c_str(), "Error connecting to the
mail server", MB_OK);
      fprintf (fp, "Mail server unavailable. Error='%s'
",
e.Message.c_str());
}

I found entries in the log file whithout a message text in the send part.
Sending to an unavailable servers shows a timeout message in the connect
part.
Or is there simply something wrong with the code?
(Indy 10.1.5 / RAD Studio 2007)

C.N.Taur

Replies