\n”;
$headers .= “From: \””.$fromname.”\” <".$fromaddress.">\n”;
return mail($toaddress, $subject, $message, $headers);
}

//Check simple captcha answer
$Answer = $_SESSION[‘CustomCaptchaAnswer’];
$CaptchaCorrect = ( escape_data($_POST[‘answer’],5,’string’) == $Answer) ? true : false;

//Check that post data exists and answer to Captcha is correct

if ( (!empty($_POST[‘name’])) && $CaptchaCorrect ) {

$formtype=escape_data($_POST[‘form_type’],30,’string’);
$fromnam=escape_data($_POST[‘name’],30,’string’);
$organization=escape_data($_POST[‘organization’],30,’string’);
$phone=escape_data($_POST[‘phone’],30,’string’);
$address=escape_data($_POST[‘address’],30,’string’);
$city=escape_data($_POST[‘city’],30,’string’);
$province=escape_data($_POST[‘province’],30,’string’);
$postalcode=escape_data($_POST[‘postalcode’],30,’string’);
$fromadd=escape_data($_POST[’email’],30,’string’);
$elist=escape_data($_POST[‘elist’],30,’string’);
$BrochureWynne=escape_data($_POST[‘Brochure-wynne’],30,’string’);
$BrochureStop=escape_data($_POST[‘Brochure-stop’],30,’string’);

//Create Body of message
$BodyText = “FORM: $formtype
\r\nNAME: $fromnam
\r\nORGANIZATION: $organization
\r\nPHONE: $phone
\r\nADDRESS: $address
\r\nCITY: $city
\r\nPROVINCE: $province
\r\nPOSTAL CODE: $postalcode
\r\nEMAIL: $fromadd
\r\nADD TO ELIST: $elist

\r\n WYNNE PAMPHLETS: $BrochureWynne
\r\n STOP PAMPHLETS: $BrochureStop

\r\n

“;

/* OLD PAMPHLETS – Unused
\r\n COAL IS COSTING US THE AIR WE BREATHE! (McGuinty,Hudak): {$_POST[‘Brochure-Coal-Costing-Hudak’]}
\r\n COAL IS COSTING US THE AIR WE BREATHE! (McGuinty,Horwath): {$_POST[‘Brochure-Coal-Costing-Horwath’]}

\r\nKNOCKOUT COAL PAMPHLETS: {$_POST[‘Brochure2-knockout’]}
\r\nCOAL EXPORT PAMPHLETS: {$_POST[‘Brochure3-export’]}
\r\nTOWERS OF POWER PAMPHLETS: {$_POST[‘Brochure4-towers’]}
\r\nNUCLEAR MONOPOLY PAMPHLETS: {$_POST[‘Brochure5-nuclear’]}
\r\nTOO BIG TOO COSTLY PAMPHLETS: {$_POST[‘Brochure-Too-big’]}
\r\nPLACES OF POWER PAMPHLETS: {$_POST[‘Brochure-Places-of-power’]}

*/

//$BodyText = strip_tags($BodyText);

//echo $BodyText;

//Send message
//mail($RecipientEmail,”OCAA SITE FORM: {$_POST[‘form_type’]}”,$BodyText,”From: {$_POST[’email’]}”);
MAIL_NVLP($fromnam,$fromadd,’OCAA Form Submission’,$RecipientEmail,”OCAA SITE FORM: $formtype”,$BodyText);

//Write thank you message

echo ‘

Thanks for ordering our pamphlets. You are helping to lead Ontario toward a green future. You can help even more by making a donation to help cover the costs of printing and shipping these pamphlets all across the province. Any amount you can give will help us to distribute more pamphlets and raise awareness. Click here to make a secure contribution right now.

‘;
echo(‘

You will receive the requested items shortly.

Please email contact@cleanairalliance.org with any questions.

‘);

} else {
echo “

There was an error with your form submission. Please hit the back button or go to the order page to try again.

“;
}

?>