I have wrote a php script that emails to multiple recipients depending on the one selected on the php form. However my problem is about a month ago i added some recipients and maybe edited something else on the sendmail.php file an now the script doesn't send the actual emil. Its brings up my "email sent" page, but non of the recipients ever receive the email. Can you help.
form.php
<form method="post" action="../sendmail.php">
<h5>Select recipient:</h5>
<select name="recipient" size="1">
<option selected="selected" value="">- - select - -</option>
<option value="Adrian">Adrian</option>
<option value="Alex">Alex</option>
<option value="Ian">Ian</option>
<option value="Kirstie">Kirstie</option>
<option value="Kristina">Kristina</option>
<option value="Louis">Louis</option>
<option value="Siobhan">Siobhan</option>
<option value="Tom">Tom</option>
</select>
<h5>Your Email:</h5><input name="email" type="text" size="30" />
<h5>Subject:</h5><input name="subject" type="text" size="30" />
<h5>Message:</h5>
<textarea name="message" rows="15" cols="40"></textarea><br />
<input type="submit" />
</form>
sendmail.php
<?php
$recipients = array(
'Adrian' => 'an@brighton.ac.uk',
'Alex' => 'es@brighton.ac.uk',
'Ian' => 'is@brighton.ac.uk',
'Kirstie' => 'nt@hotmail.com',
'Kristina' => 'ch@brighton.ac.uk',
'Louis' => 'er@brighton.ac.uk',
'Siobhan' => 'on@brighton.ac.uk',
'Tom' => '89@hotmail.com'
);
$to = $recipients[$_REQUEST['recipient']];
$subject = $_REQUEST['subject'] ;
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
if (!isset($_REQUEST['email'])) {
header( "Location: http://bce.isgreat.org/contact_form.php" );
}
elseif (empty($to)) {
header ("location: http://bce.isgreat.org/contact_form_recipient.php");
}
elseif (empty($email) || empty($message) || empty($subject)) {
header( "Location: http://bce.isgreat.org/contact_form_error.php" );
}
else {
mail( $to, "BCE Website: $subject",
$message, "From: $email");
header( "Location: http://bce.isgreat.org/contact_form_thanks.php" );
}
?>