I have a Session.MailSocket1 (and its various EventHandlers) created via code in Session.Open.
I have a SendEmail button on WebPage1.
Various Session.MailSocket1 EventHandlers call a WebPage1.WebDialog, and also hide or expose a WebPage1.ProgressWheel1 and a few WebPage1 buttons (e.g., the SendEmail button).
This all works fine most of the time. But after a while (maybe a few days), Session.MailSocket1.ConnectionEstablished fails to expose the WebPage1.ProgressWheel, and Session.MailSocket1.MailSent fails to show the WebPage1.WebDialog announcing mail is sent. However, email is always sent successfully.
It seems somehow that either Session has lost track of WebPage1, or WebPage1 has lost track of Session.
Closing the problem Session fails to resolve this. When this problem happens, all existing and new Sessions have the same problem from that point on. Killing the app fixes it, which I do by renaming the CGI file and then renaming it back, relying on Phillip Zedalis’ App.Open code that kills the app when the CGI file goes missing.
I thought I might fix this by having each Session.MailSocket1 EventHandler mentioned above call a method that refreshes WebPage1 by running WebPage1.Show before hiding or exposing the WebPage1.ProgressWheel, etc. That failed to resolve this.
So before I try another “solution,” I thought I’d post the above to get some ideas.
My other possible “solutions” to try are the following:
Attach MailSocket1 to WebPage1 instead of Session.
Leave MailSocket1 where it is (Session), but read up on how to put SendEmail in a Thread, and use a WebPage1.Timer to poll the Thread for activity that demands WebPage1 UI updates. The docs seem easy to follow on how to do this.