Email the GEFSOC Contacts
global $msg;
global $strout;
global $stremail;
switch ($HTTP_GET_VARS["action"]) {
case 0:
$strout = DisplayForm();
$msg = "Please Enter the following Required Information: - Your name, title, and email;
- Your address.
";
break;
case 1: /************ Send the email *************/
$msg = "";
$error = 0;
if ( !$_POST["fname"] ){
$msg .= "You must enter your First Name!
"; $error = 1; } if (!$_POST["lname"] ){ $msg .= "You must enter your Last Name!
"; $error = 1; } if (!$_POST["utitle"] ){ $msg .= "You must enter your title!
"; $error = 1; } if (!$_POST["txtemail"]){ $msg .= "You must enter your email address!
"; $error = 1; } if (!$_POST["street"]){ $msg .= "You must enter your street!
"; $error = 1; } if (!$_POST["city"]){ $msg .= "You must enter your city!
"; $error = 1; } if (!$_POST["state"]){ $msg .= "You must enter your state or country!
"; $error = 1; } if (!$_POST["zip"] ){ $msg .= "You must enter your zipcode or postal code!
"; $error = 1; } if ( $error == 1){ $strout = DisplayForm(); break; } else { //Validate the Email Address $stremail=$_POST["txtemail"]; $result=ereg("^[^@ ]+@[^@ ]+\.[^@ ]+$",$stremail,$regs); if(!$result){ $msg .= "You must enter a VALID EMAIL Address!
"; $_POST["txtemail"] = ""; $strout = DisplayForm(); break; } else { // check for valid mailDomain list($userName, $mailDomain) = split("@", $stremail); if (checkdnsrr($mailDomain, "MX")) { //to format for multiple user@example.com, anotheruser@example.com //LF = \n //CRLF = \r\n $to = "marke@nrel.colostate.edu,eleanor.milne@colostate.edu"; $subject = "GEFSOC Password Request"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n"; $headers .= "From: NREL GEFSOC Download Page";
$strout .= "An email message with the following content was sent to the GEFSOC contacts:"; $strout .= "Please send me the GEFSOC password."; $strout .= "Subject: ".$subject." "; $strout .= "TO: ".$to."\r\n"; $strout .= " Message: ".$message." "; $strout .= " |
Thank you for sending us your information. You will receive the download password within 24 hours.
"; } else { // this email domain doesn't exist! bad dog! no biscuit! $msg = "Bad email address! Domain: ".$mailDomain." Does not exist."; $strout = DisplayForm(); } } // end if results } // end error break; default: header("Location: http://www.nrel.colostate.edu/projects/gefsoc/email.php?action=0"); break; } function DisplayForm(){ $strout ="\r\n"; return $strout; } ?>





