Help - Search - Members - Calendar
Full Version: Form mail at later date
HTMLHelp Forums > Programming > Server-side Scripting
cedric
Hi,
Could someone get me started on how to do this (maybe a link)?
I need some kind of form that sends an email to different persons at a specific time depending on the date of input.
So, I have 3 emails written. I would like to have a form that I can fill in the recipient and choose wich mail should be sent to him.
The only thing is that the email should be sent to him only 1year after the inputdate.
Is this possible?
Or could I do this with javascript only (if possible I would prefer that).?

Thanks alot
Brian Chandler
You can only do it with javascript if you are confident that the mail recipients are going to leave the browser window open for the next 365 days!

Yes, it's simple server side programming.
cedric
simple?
SteveL
The best solution to your issue is to implement a 'scheduler' system on the server side. Breaking down the steps:

1. Create a database table that will store the email address of the recipient, the time the email should be sent, and a reference to which email should be sent, (copying the text of an identical email to potentially hundreds of records would be incredibly inefficient, so its best to store your email contents in either a flat file or another table).

2. Write a script that searches your table for emails that should go out today, and then sends those emails.

3. Execute the above script on a daily basis using a cron.


If any of the above three steps are beyond your current comprehension, I'm sure that a little bit of research into MySQL, PHP, and Cron's should sort you out.

Steve
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.