Email problem??


How to send email monthly automatically using php and mysql?
How should I do?


Well, the easiest way would be to keep a timestamp on the database such as a marker of when the last email was sent. (You do not want to send it out twice this month!) Next, every time you or anyone log’s in, that date is checked and if the date is correct, you send the emails and then reset the timestamp.

One easy way would be to set the date of the NEXT email time. Then, upon someone logging in, the date is compared to today. If it matches send emails, add 1 to the month and save it in the database. When the next user logs in, it will see that the today is less that next month and skip emails…

Did that make sense? Hope so, it is easy, once you try it… Good luck…