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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
edkellett
Forum Newbie
Posts: 8
Joined: Wed May 07, 2008 11:20 am
Location: ireland

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

Post 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
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

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

Post 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.
Post Reply