PHP - how do i auto send mail and auto delete data from database

Asked By Olusegun A. on 08-Dec-09 03:18 PM
Hello there,

Am having a membership site. After someone has registered, he will receive a confirmation mail to confirm his registration under 2 weeks. I want it to be that after a week of registration, if a member has not confirm his registration he will receive ana auto mail notifying him that his account will be deleted after a week. And if he refuse to confirm his registration after 2 weeks, his data should be deleted from the database.

How do I send auto mail to unconfirmed member after a week of registration, and how do i auto deleted


Check This - Jack jack replied to Olusegun A. on 08-Dec-09 11:59 PM

you can make an store procedure for send mail and then adjust this store procedure in scheduler with date and time to execute.

also can make a store procedure for delete data from DB and add this also in schedular.

Chetankumar Akarte replied to Olusegun A. on 09-Dec-09 12:58 AM
Hi, You can try "E*Reminders by alberciak, ninov" which allows web-clients to set up reminders to automatically E-mail them at a certain time to remind them of special events. 

Also you can do the same, but you need to run that script daily. Write new script contains reminder mail format. Write a query to get register User list not yet activated account.

echo date('l jS F (Y-m-d)', strtotime('-7 days'));

will give you date a week ago and Now check for user account not get activated since last 2 weeks and simply delete that records, you can get date, 2 week ago using script listed below.
echo date('l jS F (Y-m-d)', strtotime('-14 days'));