I need tos et up my application to send out periodic emails for my social networking site. The frequency of emails would be very sporadic based upon user interactions. FOr example my site has a QnA module - I allow users to follow questions, so every time an answer is posted all followers of the question would get an email.
I was thinking of implementing this using a cron job which would run periodically in the back ground at 5-10 minute intervals. The idea is that whenever an update is made an entry is made into a database with the list of recipients and email body. A cron job would then periodically check the database for any such jobs and execute it upon which the job would be marked as executed.
I was wondering if theres anything open source which can help me here. I just need code which sends emails in the background and all I have to provide it is the database table for the emails to send to as well as the email body.