Send E-mail periodically to mail addresses stored in mysql using php


I am trying to create a website that needs to send Email every day to the mail addresses stored in mysql. After I googling I found cron concept can be used to do this. I need to know which is the best way to do this. If cron is the best one explain me how can i create the cron file in php. I am using XAMPP in windows.

Thanks in advance...




for windows you may need to try this,

or check this one, contains more detail




All you need to do is write the php script that preforms the actions you wish, then create a cron job that executes the script. Check out this link, while it pretains to drupal the concepts should apply just fine for your case.




You need a simple php file for sending mail with your specific logic. Then you just call that php file via cron job. The process depends on your hosting server. So first decide about hosting server.




You need to setup something called a CRON job on your server.

If you are using a a hosting service, this can be done in control panel.

If you are using control panel, good explanation here:

People are also looking for solutions to the problem: add unique id to php mysql upload


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.