Thank you!
Your message has been sent!
"; // FORM ERROR MESSAGE // Shown when there is a mistake on the form // (do not use html tags - styled with .fmerrortitle). $msg_error = "Error!"; // SUBMIT BUTTON // The text for the send button (do not use html tags). $msg_submit = "Send Email"; // -------------------------------- // END OF OPTIONS // -------------------------------- // -------------------------------- // CSS DECLARATIONS // -------------------------------- // It is best to put these declarations in your main style sheet // Since it is not always proper to have CSS declarations in the middle // of a file. :) // In the form structure above, you can specify custom class names // for each input field if you like. ?> $f_max) { $errors[] = "There is a $field_max character limit for '$f_name'."; } // check for required fields if (($f_req == "true") && ($t == "")) { if ($f_fmname != $field_verification) { // has it's own check $errors[] = "Missing required field: '$f_name'."; } } // check for injection characters if (($f_type != "textarea") && (injection_chars($t))) { $errors[] = "Invalid input in '$f_name'!"; } // check for valid email (if present/required) if (($f_ver == 'email') && ($f_req == "true" || (trim($t) != ""))) { if (!is_valid_email($t)) { $errors[] = "Invalid email address: '$f_name'"; } } // check for valid url (if present/required) if (($f_ver == 'url') && ($f_req == "true" || (trim($t) != ""))) { if (!is_valid_url($t)) { $errors[] = "Invalid link: '$f_name'"; } } // check for headers/verification fields if ($f_fmname == $field_name) { if ($t != "") { $mail_name = strip_colons($t); if ($show_headers_in_message) $mail_message .= $f_name . ' = ' . $t . "\n\n"; } } elseif ($f_fmname == $field_subject) { if ($t != "") { $mail_subject = $subject . strip_colons($t); if ($show_headers_in_message) $mail_message .= $f_name . ' = ' . $t . "\n\n"; } } elseif ($f_fmname == $field_email) { if ($t != "") { $mail_email = strip_colons($t); if ($show_headers_in_message) $mail_message .= $f_name . ' = ' . $t . "\n\n"; } } elseif ($f_fmname == $field_verification) { if ($t == "") { $errors[] = "Enter the verification code!"; } else if (trim($_SESSION["thecode"]) == "") { $errors[] = "No verification code generated!"; } else if ($_SESSION["thecode"] != strtoupper($t)) { $errors[] = "Invalid verification code!"; } else { if ($show_code_in_message) $mail_message .= $f_name . ' = ' . $t . "\n\n"; } } else { if ($t != "") { $mail_message .= $f_name . ' = ' . $t . "\n\n"; } } break; case "textarea": $f_name = $form_field[2]; $f_fmname = $form_field[3]; $f_req = $form_field[6]; // get data $t = (isset($_POST[$f_fmname])) ? trim($_POST[$f_fmname]) : ""; if (get_magic_quotes_gpc()) { $t = stripslashes($t); } // check for required fields if (($f_req == "true") && ($t == "")) { if ($f_fmname != $field_verification) { // has it's own check $errors[] = "Missing required field: '$f_name'."; } } if ($t != "") { $mail_message .= $f_name . " = \n" . $t . "\n\n"; } break; case "checkbox": $f_name = $form_field[2]; $t_message = $f_name . ' ='; $f = FALSE; for ($i = 3; $i < count($form_field); $i+=3) { $f_fmname = $form_field[$i]; $f_caption = $form_field[$i+1]; $t = (isset($_POST[$f_fmname])) ? trim($_POST[$f_fmname]) : ""; if ($t == 'on') { $t_message .= " " . $f_caption . ","; $f = TRUE; } } $t_message = rtrim($t_message, ','); if ($f) { $mail_message .= $t_message . "\n\n"; } break; case "radio": $f_name = $form_field[2]; $f_fmname = $form_field[3]; $t = (isset($_POST[$f_fmname])) ? trim($_POST[$f_fmname]) : ""; $f = FALSE; for ($i = 5; $i < count($form_field); $i+=2) { if ($t == $form_field[$i]) { $f = TRUE; } } if ($f) { $mail_message .= $f_name . ' = ' . $t . "\n\n"; } break; case "select": $f_name = $form_field[2]; $f_fmname = $form_field[3]; $t_message = $f_name . ' ='; $t = (isset($_POST[$f_fmname])) ? $_POST[$f_fmname] : ""; foreach ((array)$t as $tt) { $f = FALSE; for ($i = 6; $i < count($form_field); $i++) { if (($form_field[$i] == $tt) && (trim($tt) != "")) { $f = TRUE; } } if ($f) { $t_message .= ' ' . $tt . ','; } } $t_message = rtrim($t_message, ','); if ($f) { $mail_message .= $t_message . "\n\n"; } break; } } // if no errors, process if (empty($errors)) { $mail_message = trim($mail_message); // wrap messages if set if ($wrap_messages) { $mail_message = wordwrap($mail_message, 70); } // prepare the headers // \r\n seems to be the best method for most servers to handle $ip = $_SERVER["REMOTE_ADDR"]; $mail_header = ""; $mail_header .= "MIME-Version: 1.0\r\n"; $mail_header .= "X-Sender-IP: $ip\r\n"; $mail_header .= "Content-Type: text/plain\r\n"; $mail_header .= "From: " . $mail_name . " <" . $mail_email . ">"; if ($recipients[0] == 'onerecip') { $mail_to = $recipients[1]; } elseif ($recipients[0] == 'mulrecip') { $mail_to = $recipients[2]; for ($i = 3; $i < count($recipients); $i++) { $mail_header .= "\r\n"; if ($recipients[1] == 'cc') { $mail_header .= "Cc: "; } else { $mail_header .= "Bcc: "; } $mail_header .= $recipients[$i]; } } elseif ($recipients[0] == 'selrecip') { $recip_number = (int)$_POST[$field_dropdownrecip]; foreach ($form_structure as $form_field) { if ($form_field[0] == 'selrecip') { $j = 1; for ($i = 4; $i < count($form_field); $i++) { if (strpos($form_field[$i], "#") === 0) { $i++; } $i++; if ($recip_number == $j) { $mail_to = $form_field[$i]; } $j++; } } } } // send mail, setting $email_sent to true or false if (mail($mail_to, $mail_subject, $mail_message, $mail_header, "-f $mail_email")) { $email_sent = true; } else { $errors[] = $msg_mailserver; $email_sent = false; } } if (isset($errors)) { // if there were errors, list them $t_out .= '' . $msg_error . '
GD Support not detected! GD is required for this script.
"; } $t_out .= '