// All the information you need to prepare an "Information Request Email Form", you can find on the
//"Information Request Email Form" filled out by client. If don't have one ask project manager for one.
//$toaddr="jesus@voyageurweb.com"; // address to where info collected from website will be sent to(client's email)
$toaddr="bridget@voyageurweb.com";
//$toaddr="crpd@ruralmn.org";
$headers = 'From: '.$toaddr;//optional form web form voyageurweb@voyageurweb.com
$subject="Information Request from ruralmn.org."; // Subject from "Information Request Email Form" filled out by client.
if($mission)
{ $msg="";
//Assumming all fields are required this is what the form should check for. Comment out the ones you don't need.
if(trim($fname)=="")
{
$bad=1;
$msg.="
Please enter your first name.
\n";
}
/*if(trim($lname)=="")
{
$bad=1;
$msg.="Please enter your last name.
\n";
}
if(trim($company)=="")
{
$bad=1;
$msg.="Please enter your Company or Organization name.
\n";
}
if(trim($phone)=="")
{
$bad=1;
$msg.="Please enter a phone number.
\n";
}
else
{
if(!vw_is_us_phone($phone,0))
{
$bad=1;
$msg.="Please enter a valid phone number.
\n";
}
}
if(trim($fax)=="")
{
$bad=1;
$msg.="Please enter a fax number.
\n";
}
else
{
if(!vw_is_us_phone($fax,0))
{
$bad=1;
$msg.="Please enter a valid fax number.
\n";
}
}*/
if(trim($email)=="")
{
$bad=1;
$msg.="Please enter an email address.
\n";
}
else
{
if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email))
{
$bad=1;
$msg.="Please enter a valid email address.
\n";
}
}/*
if(trim($address)=="")
{
$bad=1;
$msg.="Please enter your address.
\n";
}
if(trim($aptno)=="")
{
$bad=1;
$msg.="Please enter your Apartment/Suite No.
\n";
}
if(trim($city)=="")
{
$bad=1;
$msg.="Please enter a city name.
\n";
}
if(trim($state)=="")
{
$bad=1;
$msg.="Please select a state/province name.
\n";
}
if(trim($zip)=="")
{
$bad=1;
$msg.="Please enter your zip/postal code.
\n";
}
else
{//this is for U.S zip code only. Comment this out if Canadian users will be using this form...
if(!vw_is_us_zip($zip,0))
{
$bad=1;
$msg.="Please enter a valid zip code.
\n";
}
}
if(trim($Country)=="")
{
$bad=1;
$msg.="Please select a country.
\n";
}
if(trim($comments)=="")
{
$bad=1;
$msg.="Please enter your comments.
\n";
}*/
//If some information was missing error messages will be outputed,
//else the information collected will be sent off to client.
if($bad)
{
echo "You have missed some required information.
\n";
echo "$msg
\n";
echo "\n";
}
else
{//this is where the body of the message for the email is composed. Comment what you don't need
$mailbody .="Name:\t$fname\n";
// $mailbody .="Last Name:\t$lname\n";
$mailbody .="Organization:\t$company\n";
$mailbody .="Phone:\t$phone\n";
//$mailbody .="Fax:\t$fax\n";
$mailbody .="Email:\t$email\n";
/* $mailbody .="Address:\t$address\n";
$mailbody .="Apartment/Suite No:\t$aptno\n";
$mailbody .="City:\t$city\n";
$mailbody .="State/Province:\t$state\n";
$mailbody .="ZIP/Postal Code:\t$zip\n";
$mailbody .="Country:\t$Country\n";
$mailbody .="Comments\t$comments\n";*/
$mailbody.="\n\n";
//once the message has been formatted it will be sent to client.
mail($toaddr, $subject, $mailbody);
//Check "Information Request Email Form" to see if an email will be sent to user, and what information
//it will contain.
//$mailbody2.="Thank you for your interest! We will contact you soon.\n";
//$mailbody2 .=$mailbody;
//headers could be used for everybody receiving this email. In this case only the user will received the "From:" part.
//mail($email, $subject, $mailbody2,$headers);
//Check for message that user should see when form is submitted see "Information Request Email Form"
$msg .="Thank you for your interest! We will contact you soon.
";
//This is where the message is shown to user
echo "".$msg."
";
//This will hide the form and just show the message above.
$hideform=true;
}
}
if(!$hideform){
?>
Items denoted with * are required.
}//closes the if statement above to hide the form from user after submit is successful.?>