Like I said, it depends on how robust a solution you want/need. If you need a more robust system, I would stash e-mails in a database along with a send time. Then I'd run a cron job that looked in the database for messages that were ripe to send. The message has to persist between generation and sending somehow;
sleep keeps in in memory and either a database or possibly
Storable stashes it on disk.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.