Re: Exception

Giganews Newsgroups
Subject: Re: Exception
Posted by:  Remy Lebeau \(TeamB\) (no.spam@no.spam.com)
Date: Thu, 27 Mar 2008

"duf" <d…@wp.pl> wrote in message news:BEAC76C2DD4DE340d…@wp.pl...

> How can I catch the exception if send message is incorrect?

You already are.  However, you should be wrapping just Send() by itself, ie:

    IdSMTP1->Connect();
    try
    {
        IdSMTP1->Send(IdMessage1);
    }
    catch (const Exception &e)
    {
        MessageDlg( e.Message, mtWarning , TMsgDlgButtons() << mbOK, 0);
    }
    IdSMTP1->Disconnect()

Gambit

Replies

None

In response to

Exception posted by duf on Thu, 27 Mar 2008