Bericht aan Jonas de Jong | |
Gebruik dit formulier om contact op te nemen. Een evt. bijlage (.PDF, .JPG of .PNG max 1mb) kunt u meesturen met de knop 'Bladeren'. Voor persoonlijke medische vragen verwijs ik naar uw behandelend arts. |
Bedankt voor het bericht. Klik hier om terug te gaan naar de hoofdpagina. |
Oops! You forgot to fill out the email address! Click on the back arrow to go back
"); } elseif (!checkEmail($email)) { die ("Invalid e-mail adres"); } else { $from_name = stripslashes($_POST['from_name']); $subject = stripslashes($_POST['subject']); $body = stripslashes($_POST['body']); $to_email = $_POST['to_email']; $attachment = $_FILES['attachment']['tmp_name']; $attachment_name = $_FILES['attachment']['name']; if (is_uploaded_file($attachment)) { //Do we have a file uploaded? $fp = fopen($attachment, "rb"); //Open it $data = fread($fp, filesize($attachment)); //Read it $data = chunk_split(base64_encode($data)); //Chunk it up and encode it as base64 so it can emailed fclose($fp); } //Let's start our headers $headers = "From: $from_name<" . $_POST['from_email'] . ">\n"; $headers .= "Reply-To: <" . $_POST['from_email'] . ">\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/related; type=\"multipart/alternative\"; boundary=\"----=MIME_BOUNDRY_main_message\"\n"; $headers .= "X-Sender: $from_name<" . $_POST['from_email'] . ">\n"; $headers .= "X-Mailer: PHP4\n"; $headers .= "X-Priority: 3\n"; //1 = Urgent, 3 = Normal $headers .= "Return-Path: <" . $_POST['from_email'] . ">\n"; $headers .= "This is a multi-part message in MIME format.\n"; $headers .= "------=MIME_BOUNDRY_main_message \n"; $headers .= "Content-Type: multipart/alternative; boundary=\"----=MIME_BOUNDRY_message_parts\"\n"; $message = "------=MIME_BOUNDRY_message_parts\n"; $message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n"; $message .= "Content-Transfer-Encoding: quoted-printable\n"; $message .= "\n"; /* Add our message, in this case it's plain text. You could also add HTML by changing the Content-Type to text/html */ $message .= "$body\n"; $message .= "\n"; $message .= "------=MIME_BOUNDRY_message_parts--\n"; $message .= "\n"; $message .= "------=MIME_BOUNDRY_main_message\n"; $message .= "Content-Type: application/octet-stream;\n\tname=\"" . $attachment_name . "\"\n"; $message .= "Content-Transfer-Encoding: base64\n"; $message .= "Content-Disposition: attachment;\n\tfilename=\"" . $attachment_name . "\"\n\n"; $message .= $data; //The base64 encoded message $message .= "\n"; $message .= "------=MIME_BOUNDRY_main_message--\n"; // send the message mail("[email protected]", $subject, $message, $headers); } } function checkEmail($email) { // checks proper syntax if( !preg_match( "/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $email)) { return false; } // gets domain name list($username,$domain)=split('@',$email); // checks for if MX records in the DNS $mxhosts = array(); error_reporting(0); if(!getmxrr($domain, $mxhosts)) { // no mx records, ok to check domain if (!fsockopen($domain,25,$errno,$errstr,30)) { return false; } else { return true; } } else { // mx records found foreach ($mxhosts as $host) { if (fsockopen($host,25,$errno,$errstr,30)) { return true; } } return false; } } print <<< EOT EOT; ?>