
Untitled
By: a guest on
May 11th, 2012 | syntax:
None | size: 0.56 KB | hits: 15 | expires: Never
How to use a php email variable with cron using a database
<?php
if(isset($_POST['email']))
{
$headers = "From: Memory Jet <your_company@example.com>rn";
$to_visitor = $_POST["email"];
$common_data = $_POST["message"];
mail($to_visitor, "Your Memory", $common_data, $headers);
} ?>
id - some record identifier
message - text of the message
to - recipient
from - sender
date_to_send - date to send message on
sent - boolean flag indicating pending/already sent
SELECT id, message, to, from
FROM yourtable
WHERE (date_to_send < now()) AND (sent = false)