File: D:/HostingSpaces/SBogers10/rooymansde.komma-mediadesign.nl/wwwroot/belMeTerugVerzenden.php
<?php
include("all_kms_con.inc.php");
$datum = date("d.m.y");
$tijd = date("H:i:s");
if(isset($_POST['secretcode'])){
$secretcode = $_POST['secretcode'];
if($secretcode == "spamcheckkomma"){
$valid_secretcode = true;
}else{
$valid_secretcode = false;
}
}else{
$valid_secretcode = false;
}
if(isset($_POST['naam'])){
$naam = $_POST['naam'];
}
if(isset($_POST['telefoon'])){
$telefoon = $_POST['telefoon'];
$telefoon = trim($telefoon);
$telefoon = str_replace("-","",$telefoon);
$telefoon = str_replace(" ","",$telefoon);
$telefoon = str_replace("+","00",$telefoon);
$valid_telefoon = true;
}else{
$valid_telefoon = false;
}
if(isset($_POST['paginaURL'])){
$pagina_url = $_POST['paginaURL'];
}
if(!empty($naam) && $valid_telefoon && $valid_secretcode && !empty($pagina_url)){
$datum = date("Y-m-d");
$tijd = date("H:i:s");
$datum = date_dutch($datum);
require_once 'css-js/phpmailer/class.phpmailer.php';
$bericht_klant = "\n
<body style=\"margin: 10px; background-color:#fff;\">
<style>
a{
color:#0063BD;
text-decoration:underline;
}
</style>
<div style=\"color:#6B6663; font-family:Verdana,Geneva,sans-serif; font-size:11px; line-height:18px; padding-bottom:23px; width: 800px;\">
Bij deze de gegevens van een persoon die het bel met terug formulier op Rooymans Neckwear.co.uk heeft ingevuld.<br>
Ingevuld op $datum om $tijd<br><br>
<strong>Contactgegevens: </strong><br>
Naam: 	 	 $naam<br>
Telefoonnummer: 	 $telefoon<br>
Vanaf pagina: 	 $pagina_url<br>
<br><br>
</div>
</body>";
$send_message = false;
$from = "info@rooymans-ties.co.uk";
$from_naam = "Rooymans Neckwear";
$onderwerp = "Bel me terug Rooymans Neckwear.co.uk";
$mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch
try {
$mail->AddReplyTo($from , $from_naam);
$mail->AddAddress($from, $from_naam);
$mail->SetFrom($from, $from_naam);
$mail->AddReplyTo($from, $from_naam);
$mail->Subject = $onderwerp;
$mail->MsgHTML($bericht_klant);
$mail->Send();
$send_message = true;
} catch (phpmailerException $e) {
$send_message = false;
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
$send_message = false;
echo $e->getMessage(); //Boring error messages from anything else!
}
}?>