|
 |
|
$HTTP_POST_VARS = $_POST;
if ($submit) {
//echo "Uw bestelling is doorgevoerd";
function send_email($frm) {
global $CFG, $ME;
require("lib/class.phpmailer.php");
$mail = new phpmailer();
$mail->Host = "localhost";
$mail->IsSMTP();
$mail->From = $frm["email"];
$mail->Sender = "info@topolis.nl"; //is retrun-path
$mail->FromName = $frm["naam"];
$mail->Subject = "Bestelling Topolis film via topolis.nl";
// $mail->WordWrap = 50;
$validemail = CheckEmailAdress($frm["email"]);
if ($validemail) {
$mail->From = $frm["email"];
} else {
$mail->From = "niet geldig";
}
class object {};
$var = new Object;
$var->bestelling = "";
if ($frm["dvd1"]) {
$var->bestelling .= "DVD 'De voorbereiding' aantal: ".$frm["aantaldvd1"]."\n";
}
if ($frm["vhs1"]) {
$var->bestelling .= "Video 'De voorbereiding' aantal: ".$frm["aantalvhs1"]."\n";
}
if ($frm["dvd2"]) {
$var->bestelling .= "DVD 'The making of...' aantal: ".$frm["aantaldvd2"]."\n";
}
if ($frm["vhs2"]) {
$var->bestelling .= "Video 'The making of...' aantal: ".$frm["aantalvhs2"]."\n";
}
$var->naam = $mail->FromName;
$var->bedrijf = $frm["bedrijf"];
$var->functie = $frm["functie"];
$var->straat = $frm["straat"];
$var->postcode = $frm["postcode"];
$var->plaats = $frm["plaats"];
$var->telefoon = $frm["telefoon"];
$var->email = $mail->From;
$mail->Body = read_template("templates/email/mail_body.txt", $var);
$mail->ClearAllRecipients();
$mail->AddAddress($mail->Sender);
$mail->Send();
echo "";
echo "Uw email wordt verzonden...moment";
die;
}
function CheckEmailAdress($email) {
return ereg(
"[A-Za-z0-9_-]+([\.]{1}[A-Za-z0-9_-]+)*@[A-Za-z0-9-]+([\.]{1}[A-Za-z0-9-]+)+",
$email);
}
function read_template($filename, &$var) {
$temp = str_replace("\\", "\\\\", implode(file($filename), ""));
$temp = str_replace('"', '\"', $temp);
eval("\$template = \"$temp\";");
return $template;
}
send_email($HTTP_POST_VARS);
} else {
?>
} ?>
|
|
|