PHP Code:
<?
/* The skeleton */
$who = $_POST['who'];
$typeOfInfo = $_POST['typeOfInfo'];
$nameOfWho = array(
"pinsured" => "Prospective insured",
"pagent" => "Prospective agent",
"insured" => "Insured",
"agent" => "Agent",
"unknown" => "Uknown Person");
$nameOfInfo = array(
"Request Claim Information",
"Request information about my policy",
"Request information about obtaining my policy",
"Request my password",
"Comment on your website",
"Contact you on an unlisted topic");
$list = array(
"john.doe@mail.com",
"Homer.Sexual@moes.com",
"trustno1@aol.com"
); /* for gathering addresses of interested parties */
switch ($who) {
case "pinsured" :
$mailing = "$list[0], $list[3]";
break;
case "insured" :
$mailing = $list[2];
break;
/* blah, blah, blah so on, so forth */
default:
die("You should select who you are");
}
$post = "$name, a ". $nameOfWho[$who].
" wants to ". $nameOfInfo[$typeOfInfo] .
":
Additional comment was:
$comment\n";
mail($mailing,
"An information requested",
$post) or die("Mail session failed! The query was not sent, contact the administrator");
?>
Bookmarks