I've removed the NetAutoCloseServer from the main app window and I've added
IF Loc:FirstTimeRun = 0
Loc:FirstTimeRun = 1
Loc:RandomSleepPeriod = Random(GLO:EmailThreads * 10,GLO:EmailThreads * 1000)
dbg.DebugOut(Thread() &' '& GetCurrentThreadID() & ' Timer1 Loc:RandomSleepPeriod='&Loc:RandomSleepPeriod)
Sleep(Loc:RandomSleepPeriod)
dbg.DebugOut(Thread() &' '& GetCurrentThreadID() & ' Timer1 In the words of Murray Walker... He''s Off, He''s Off, He''s Off!')
END
to the SendScheduleEmail window immediately before the routine call Do SendEmail in the TimerEvent to make sure each thread doesnt start at the same time.
So the 1st random delayed start on which ever thread is first in theory fires up the NT send email engine which should do the equivalent job of your suggestion to place NetAutoCloseServer on the main app window?
However despite the above workaround the NT send email engine is duplicating emails and I still get some GPF's but not as often, its random.
Does the NT send email engine need a minimum period of time between each 1st send on each thread because the risk with the random delay workaround is I might still get two threads starting for the first time very close together in terms of term, maybe just milliseconds apart?
Is the NT SendEmail code threaded or is it just one thread handling the asynchronous communication despite being called multiple threads?
I wonder why you havent seen this in your apps which are running multi threaded that you mentioned in a previous post?