Jump to content

Send mail via TuniThreadTimer


Mike

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 1 year later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...