Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 0.56 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to use a php email variable with cron using a database
  2. <?php    
  3. if(isset($_POST['email']))
  4. {
  5.  
  6.  $headers = "From: Memory Jet <your_company@example.com>rn";
  7.  
  8.  
  9. $to_visitor = $_POST["email"];
  10. $common_data = $_POST["message"];
  11. mail($to_visitor, "Your Memory", $common_data, $headers);
  12.  
  13. } ?>
  14.        
  15. id - some record identifier
  16. message - text of the message
  17. to - recipient
  18. from - sender
  19. date_to_send - date to send message on
  20. sent - boolean flag indicating pending/already sent
  21.        
  22. SELECT id, message, to, from
  23. FROM yourtable
  24. WHERE (date_to_send < now()) AND (sent = false)