I have a MySQL database that has a list of items which gets updated everyday. The database is truncated everyday and filled back with the recent posts. After it is filled out, I need an automatic system that will send out the emails to users who have provided certain keyword. I have a search query in place that will search through those posts, but I cannot figure out the email alert part. I just want to make something similar to a new job alert...

What could be the potential tools that I can use to accomplish this? Currently all my website is in php. Thanks!!

Recommended Answers

All 2 Replies

If your web host supports Cron (most Linux hosts do)) then you need to set up a PHP job to select the records and do the emailing and schedule it using Cron. Your web host should be able to provide you with info on how to set it up but it is quite straightforward. If you are running on a Windows host, they should have an equivalent facility.

To do the mailing, you can build it yourself using the PHP mail command or you can use a library that makes it a bit easier (especially if you are sending attachments). More info on that here.

commented: useful post +6

Thanks for your help. Yes, I do use cron jobs for other tasks and I see that as a possibility. I am now facing an error with the mail command. Let me put it here for your review. Thanks again..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.