Page 1 of 1

PHP Mail() more than one e mail at different later dates

Posted: Wed May 07, 2008 11:24 am
by edkellett
Hi,

Looking for help.

How can I take someones e mail address from a form and use the mail() function to send 5 different e mails to that e mail address at different time...
e.g:
email 1 today
email 2 tomorrow
email 3 on day 3
email 4 on day 4
email 5 on day 5

Can this be done with some sort of delay set on the mail function?

Ed

Re: PHP Mail() more than one e mail at different later dates

Posted: Wed May 07, 2008 5:25 pm
by Jade
All you have to do is send the data with the date property attached as an additional field. Then change the date value to whatever you want the date to be on the email. Note that even if the date field on the email is different, all 5 emails will be sent out at the SAME time.

If you want to send another email at DIFFERENT times, then you'll have to write a script that looks up users who have been sent less then 5 emails, then send them another email and update the count of how many emails you've sent them. Then run this script as a cronjob so it does all the work for you automatically.