Hi
Got a problem with the following code. What im trying to do is in the previous form i got a drop down list which containes values that are email addresses, so if they click on complaints, email goes to catherine.carne etc
Insted of having a static subject, i want to create a dynamic one where the subject is according what field the user chooses in the previous form. Am i thinking in the right way or is a switch the wrong thing? HELP ME PLEASE!!!
<?
$subject = $POST['subject'];
$name = $POST['name'];
$email = $POST['email'];
$comments = $POST['comments'];
switch($subject_title):
case "catherine.carne":
echo "Complaint or suggestion";
break;
case "irene.katris":
echo "General enquiry";
break;
case "amar.afzal":
echo "Web enquiry";
break;
default:
echo "";
break;
endswitch;
$to2 = $subject;
$from_header2 = "talent website";
$subject2 = "Contact us - $subject_title";
$message2 .= "Contact name: $name\n";
$message2 .= "Contact email: $email\n";
$message2 .= "Comments:\n $comments\n\n";
$message2 .= "--------------------------------------------------------------------\n";
$message2 .= "This is an automated message. Please do not reply to this email\n";
$message2 .= "For assistance, please contact the web team\n";
$message2 .= "--------------------------------------------------------------------\n";
mail($to2, $subject2, $message2, "From: $from_header2\n");
?>