Current location: Hot Scripts Forums » Programming Languages » Everything Java » Help! Time Delayed Email Script!


Help! Time Delayed Email Script!

Reply
  #1 (permalink)  
Old 04-20-09, 11:00 AM
tmedic tmedic is offline
New Member
 
Join Date: Apr 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Help! Time Delayed Email Script!

Thanks for looking at my distress call! I have a form and I am trying to come up with a way to do the following:

Wen the user presses "submit" I need the form to email the form information to the value of the email field (with the other fields in the subject) after the specified number of hours in the Time field. I can handle the form and email part however I am stuck on the time delay part. I have seen script examples for a delay in seconds but is it possible to delay a script for hours?

Thanks for any help you can give!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 04-20-09, 12:45 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by tmedic View Post
I have seen script examples for a delay in seconds but is it possible to delay a script for hours?
You don't want to do this, for a number of reasons. What you want to do is use a cron job to send out a list of queued up emails when the time is right.

Store the emails in a table with a "send on" time field, then run a cron job every 5 minutes (or whatever) to scan the table, match the "send on" times, and then send the emails.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 04-21-09, 03:28 PM
tmedic tmedic is offline
New Member
 
Join Date: Apr 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
End user - Thanks for the help. Time to get to work on that table, the cron job seems pretty straight forward.
Thanks again
- tim
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need A Free Paid To Read Email Script interiq Script Requests 1 09-10-08 08:32 AM
Changing email sent through PHP script lsilver PHP 2 05-18-06 10:03 PM
CGI Script Form to Email Help!!! EOM Perl 1 06-22-05 01:19 AM
will pay. php script needed. upload, resize, & email jamjammo Script Requests 4 02-29-04 09:30 PM


All times are GMT -5. The time now is 09:24 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.