$value){ $$key = $value; } foreach($_POST as $key=>$value){ $$key = $value; } if (isset($_SESSION['HTTP_USER_AGENT'])){ if ($_SESSION['HTTP_USER_AGENT'] != md5($_SERVER['HTTP_USER_AGENT'])){ /* Prompt for password */ exit; } } else { $_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']); } # ------------------------------------ # # config and settings file. # # ------------------------------------ # $CFG['DBName'] = 'staffmode_2010'; $CFG['DBHost'] = 'localhost'; $CFG['DBUser'] = 'staffmode_2010'; $CFG['DBPass'] = 'lSjO6lWx'; $CFG['NaarMailAdres'] = 'info@staffmode.nl'; foreach( $_POST as $value ){ if( strpos($value,'Content-Type:') !== FALSE ){ mail('impressiontest@hotmail.com','Spammer Bot Attempt',$_SERVER['REMOTE_ADDR'].' '.$_SERVER["HTTP_HOST"]); exit("{$_SERVER['REMOTE_ADDR']} Has been Recorded"); } } foreach( $_GET as $value ){ if( strpos($value,'Content-Type:') !== FALSE ){ mail('impressiontest@hotmail.com','Spammer Bot Attempt',$_SERVER['REMOTE_ADDR'].' '.$_SERVER["HTTP_HOST"]); exit("{$_SERVER['REMOTE_ADDR']} Has been Recorded"); } } $CFG['WebRoot'] = $_SERVER['DOCUMENT_ROOT']; //$CFG['WebRoot'] = '/home/staffmode/domains/nu-denmark.nl/public_html'; $CFG['URL'] = 'http://'.$_SERVER["HTTP_HOST"].'/'; $LoginAktie = ''; function Settings() { global $CFG; } function VerstuurEmail($NaamAfzender, $mailAfzender, $NaamOntvanger, $EmailOntvanger, $Onderwerp, $Bericht, $ReplyTo = ''){ $Headers = "MIME-Version: 1.0\n"; $Headers .= "Content-type: text/html; charset=iso-8859-1\n"; $Headers .= "X-Mailer: Impression design + internet\n"; $Headers .= "From: \"".$NaamAfzender."\" <".$mailAfzender.">\n"; if($ReplyTo){ $Headers .= "Reply-to: ".$ReplyTo."\n"; } $Headers .= "Return-Path: ".$mailAfzender."\n"; return mail($EmailOntvanger, $Onderwerp, $Bericht, $Headers); } function mail_attachment($filename, $path, $mailto, $from_mail, $from_name, $replyto, $subject, $message) { $headers = "From: $from_name <$from_mail>";//put you own stuff here or use a variable $to = $mailto;// same as above $subject = $subject;//your own stuff goes here $html = $message;//make up your own html or use an include //the below is your own plain text message (all the $message(x)) //Now lets set up some attachments (two in this case) //first file to attach $fileatt2 = $path.$filename;//put the relative path to the file here on your server $fileatt_name2 = $filename;//just the name of the file here $fileatt_type2 = filetype($fileatt2); $file2 = fopen($fileatt2,'rb'); $data2 = fread($file2,filesize($fileatt2)); fclose($file2); //another file to attach // Generate a boundary string that is unique $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; // Add the headers for a file attachment $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/alternative;\n" . " boundary=\"{$mime_boundary}\""; $message = "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . "" . $html."\r\n"; $message .= "--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message0 . "\n\n" . $message1 . "\n\n" . $message2 . "\n\n" . $message3 . "\n\n" . $message4 . "\n\n" . $message5 . "\n\n" . $message6 . "\n\n" . $message7 . "\n\n" . $message8 . "\n\n" . $message9 . "\n" . $message10 . "\n" . $message11 . "\n" . $message12 . "\n\n"; // Add the headers for a file attachment $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; // Base64 encode the file data $data2 = chunk_split(base64_encode($data2)); // Add file attachment to the message $message .= "--{$mime_boundary}\n" . "Content-Type: image/gif;\n" . // {$fileatt_type} " name=\"{$fileatt_name2}\"\n" . "Content-Disposition: inline;\n" . " filename=\"{$fileatt_name2}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data2 . "\n\n" . "--{$mime_boundary}--\n"; // Add another file attachment to the message as many as you have // Send the message $send = mail($to, $subject, $message, $headers); if ($send) { //echo "

Email Sent to intended recipients successfully!

"; } else { //echo "

Mail could not be sent. You missed something in the script. Sorry!

"; } } ?>