Mike Posted March 19, 2018 Share Posted March 19, 2018 I have a table which each record contains a mail message. For sending out e-mails I would like to use a TuniThreadTimer placed on server module and a seperate database connection. Must I use some locking in the thread or is this setup sufficient enough? Quote Link to comment Share on other sites More sharing options...
Ron Posted March 22, 2018 Share Posted March 22, 2018 If you make a thread object and create the db connection and the SMTP client within that thread, triggering the thread create using an external timer, I think it should work out fine. The problem may arise if the thread is not finished before being triggered again, but you can check if the thread object exists, and wait some more. You can also drop the timer outside of the thread, and use a loop/delay inside, in the execute routine, to fetch emails from the db and send. In that case the thread should start as the app loads, and stay running until the app shuts down. But I rather make a separate application for such things, running it as a service, totally independent from Unigui, based on a thread object. Quote Link to comment Share on other sites More sharing options...
Mike Posted March 22, 2018 Author Share Posted March 22, 2018 I have already used a TuniThreadTimer and need to be sure it is safe to use. 1 Quote Link to comment Share on other sites More sharing options...
Ron Posted March 29, 2018 Share Posted March 29, 2018 To be sure, you have to test it, so set up some simulation where you post a million emails to an offline SMTP server, and see what happens. 1 Quote Link to comment Share on other sites More sharing options...
freedowsRoO Posted March 4, 2020 Share Posted March 4, 2020 On 3/22/2018 at 2:56 PM, Mike said: I have already used a TuniThreadTimer and need to be sure it is safe to use. Hello! Are you used idSMT to send the email? Quote Link to comment Share on other sites More sharing options...
Mike Posted March 5, 2020 Author Share Posted March 5, 2020 Hi, Instead of TuniThreadTimer I am now using a Windows service for sending e-mail. 1 Quote Link to comment Share on other sites More sharing options...
mhmda Posted March 5, 2020 Share Posted March 5, 2020 1 hour ago, Mike said: Hi, Instead of TuniThreadTimer I am now using a Windows service for sending e-mail. correct way Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted March 6, 2020 Share Posted March 6, 2020 5 hours ago, Mike said: Oi, Em vez de TuniThreadTimer, agora estou usando um serviço do Windows para enviar email. How are you doing? How to show? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.