[insert_php]

include( “files/contact/email_func.php” );
include(“files/contact/incl_glbl.php”);

InitGlobals();

LoadCSVEMailData();

$msg_sent = 0;
$count = 0;

// I’m not going to name the general contact at this point….
//if ( $general_name != “” )
//{
// $contacts[$count] = “General Information – ” . $general_name;
// $count++;
//}
$contacts[$count] = “General Information”;
$emails[$count] = “info@sbe59.org”;
$count++;

if ( $chairman_name != “” )
{
$contacts[$count] = “Chairman ” . $chairman_name;
$emails[$count] = $chairman;
$count++;
}

if ( $vicechairman_name != “” )
{
$contacts[$count] = “Vice Chairman ” . $vicechairman_name;
$emails[$count] = $vicechairman;
$count++;
}

if ( $secretary_name != “” )
{
$contacts[$count] = “Secretary ” . $secretary_name;
$emails[$count] = $secretary;
$count++;
}

if ( $treasurer_name != “” )
{
$contacts[$count] = “Treasurer ” . $treasurer_name;
$emails[$count] = $treasurer;
$count++;
}

if ( $pastchairman_name != “” )
{
$contacts[$count] = “Past Chairman ” . $pastchairman_name;
$emails[$count] = $pastchairman;
$count++;
}

if ( $certification_name != “” )
{
$contacts[$count] = “Certification ” . $certification_name;
$emails[$count] = $certification;
$count++;
}

if ( $newsletter_name != “” )
{
$contacts[$count] = “Newsletter ” . $newsletter_name;
$emails[$count] = $newsletter;
$count++;
}

if ( $programs_name != “” )
{
$contacts[$count] = “Programs ” . $programs_name;
$emails[$count] = $programs;
$count++;
}

if ( $frequency_name != “” )
{
$contacts[$count] = “Frequency Coordinator ” . $frequency_name;
$emails[$count] = $frequency;
$count++;
}

if ( $eas_name != “” )
{
$contacts[$count] = “EAS ” . $eas_name;
$emails[$count] = $eas;
$count++;
}

if ( $webmaster_name != “” )
{
$contacts[$count] = “Website ” . $webmaster_name;
$emails[$count] = $webmaster;
$count++;
}

if ( $rsvp != “” )
{
$contacts[$count] = “RSVP for Event”;
$emails[$count] = $rsvp;
$count++;
}

if ( isset( $_REQUEST[“Name”] ) )
{
$nm = $_REQUEST[“Name”];
}
else
{
$nm = “General”;
}

$sel_str = 0;
for ($i=0; $i < $count; $i++) { if ( strpos( $contacts[$i], $nm ) !== FALSE ) { $sel_str = $i; break; } } if ( isset( $_REQUEST["Submit"] ) ) { $contact_str = ""; $send_to = ""; $subject = "Message from SBE 59 Website"; $send_from = ""; $message = ""; for ($i = 0; $i < $count; $i++) { if ( isset( $_REQUEST["s_mailto"] ) ) { if ( $_REQUEST["s_mailto"] == $contacts[$i] ) { $send_to = $emails[$i]; $contact_str = $contacts[$i]; break; } } } if ( isset( $_REQUEST["s_subject"] ) ) { $subject = "SBE 59 Website: " . $_REQUEST["s_subject"]; } if ( isset( $_REQUEST["s_name"] ) ) { $from_name = $_REQUEST["s_name"]; } if ( isset( $_REQUEST["s_email"] ) ) { $send_from = $_REQUEST["s_email"]; } if ( isset( $_REQUEST["s_message"] ) ) { $message = $_REQUEST["s_message"]; } $ok_to_send = false; if ( isset( $_REQUEST["tsy"] ) ) { if ( $_REQUEST["tsy"] == "xk401b" ) { $ok_to_send = true; } } if ( ! (strpos( $subject, 'tramadol' ) === false) ) { $ok_to_send = false; } if ( ! (strpos( $subject, 'xanax' ) === false) ) { $ok_to_send = false; } if ( ! (strpos( $subject, 'ultram' ) === false) ) { $ok_to_send = false; } if ( ! (strpos( $subject, 'SEO' ) === false) ) { $ok_to_send = false; } echo "Your message has been sent!\n”;
echo “

——————-
\n”;
echo “

\n";
	echo "To: " . $contact_str . "\n";
	echo "From: " . $from_name . " (" . $send_from . ")\n";
	echo "Subject: " . $subject . "\n\n";
	echo $message;
	echo "

\n”;
echo “—————————
\n”;

$message = “New message from the SBE Chapter 59 Website\n\n” .
“To: ” . $contact_str . “\n” .
“From: “.$from_name.” “.
“Email: “.$send_from.”\n”.
“\nMessage:\n”.
“——————————\n”.
$message.”\n”.
“——————————\n”;

if ( $ok_to_send )
{
mail($send_to, $subject, $message,
“From: “.$send_from.”\r\n”
.”Reply-To: “.$send_from);
}

$msg_sent = 1;
}

if ( $msg_sent == 0 )
{

echo “

Filling out this form will send an e-mail to the selected individual. Phone numbers for chapter officers can be found on the “;
echo “officers page of the web site…

“;
echo “

“;
echo ”

Send Message To: “;
echo ” “;
echo ”

“;
echo ”

Your Name: “;
echo ” “;
echo ”

“;
echo ” “;
echo ”

Your e-mail address: “;
echo ” “;
echo ”

“;
echo ”

Subject: “;
echo ” “;
echo ”

“;
echo ”

Message:

“;
echo ”

“;
echo ” “;
echo ”

“;
echo ”

“;
echo ” “;
echo ”

“;
echo “

“;

} // if ( $msg_sent == 0 )

[/insert_php]