inserting time delay into mail function

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
MunsonBurner
Forum Newbie
Posts: 1
Joined: Wed Jun 25, 2008 4:47 am

inserting time delay into mail function

Post by MunsonBurner »

mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$from." <".$Email.">");


This is my mail function, which works fine and sends an email automatically to $ToEmail.

I would like to delay the sending of the email by 15 minutes to mimic a real person response as opposed to an automatic one.

Any ideas?

Cheers
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: inserting time delay into mail function

Post by Christopher »

Store the email in a queue (such as a database table) with a timestamp and have a separate process (cron) send the emails based on the timestamp.
(#10850)
Post Reply