I have a small web app where people can send a message via email to a group. but because of spam I will have to make an approval procedure.

message is being sent via php. How am I doing so I have to accept the message before its send to an email that forward it to the group?

my php:

<?php 
$errors = '';
$myemail = 'whatever@gmail.com';//<-----Put Your email address here.
if(empty($_POST['name'])  || 
   empty($_POST['email']) || 
   empty($_POST['message']))
{
    $errors .= "\n FEJL: Alle felter skal udfyldes";
}

$name = $_POST['name']; 
$email_address = $_POST['email']; 
$message = $_POST['message']; 
$email_subject = "Form request";
$times = $_POST["timeslots"];

if (!preg_match(
"/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i", 
$email_address))
{
    $errors .= "\n FEJL: Ugyldig email adresse";
}
$strTimes = implode($times);
if( empty($errors))
{
$to = $myemail; 
$email_subject = "$message \n ";
$email_body = "\n Code: $strTimes \n Navn: $name \n Email: $email_address \n"; 

$headers = "From: $email_address\n"; 
$headers .= "Reply-To: $email_address";

mail($to,$email_subject,$email_body,$headers);
//redirect to the 'thank you' page
header('Location: thx.html');
} 
?>

    I guess it depends on how you want to do it. The easy way is to have all emails sent to the moderator who can then just forward them to a mailing list if approved. The other alternative is to store the email details in the system (database or file) and wait until a moderator logs-in, reviews each email, hits the approve button and then it programmatically sends the e-mails out.

      Write a Reply...