Does you console mode program have a message pump ?
Without message pump, you wont have any event triggered.
----- Original Message -----
From: "Patrick Wong" <[EMAIL PROTECTED]>
Sent: Wednesday, June 22, 2005 4:48 AM
Subject: [twsocket] Assign event handler to manually created TStmpCli object
> Dear all,
> I am writing a simple mail client in console application form. I manually
> created a TSmtpCli
object for my purpose.
> The problem is that after I call the SmtpClient->Connect() method, the client
> fails to connect to
the SMTP server. I referenced the MailSnd example and did set
properties as in MailSnd. Using MailSnd to connect and send mail to server
does not have problem.
> I notice that the events SmtpClientDisplay and SmtpClientRequestDone in
> MailSnd will be triggered
when response is received from SMTP server. I place similar event handlers in
my program in an
attempt to print message on the console window, but the events just will not be
triggered. I assign
the event handlers in the following way:
> SmtpClient = new TSmtpCli(NULL);
> if(SmtpClient != NULL)
> SmtpClient->OnDisplay = SmtpClientDisplay;
> SmtpClient->OnRequestDone = SmtpClientRequestDone;
> Is it the proper way to assign event handler? How can I trace where the
> problem is in failing to
connect to SMTP server?
> Many thanks,
> Patrick Wong
> To unsubscribe or change your settings for TWSocket mailing list
> please goto http://www.elists.org/mailman/listinfo/twsocket
> Visit our website at http://www.overbyte.be
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be