<!DOCTYPE html>
<html>
    <head lang="de">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
        <meta name="description" content="xxx.de">
        <meta name="keywords" content="xxx">
        <meta name="author" content="Holger">
        <meta name="publisher" content="xxx.de">
        <meta name="page-topic" content="xxx">
        <meta name="robots" content="index,follow">
        <meta name="revisit-after" content="14 days">
        <meta name="audience" content="alle">
        <title>Kontakt</title>
        <link rel='shortcut icon' type='image/x-icon' href='favicon.ico' />
        <link href="css/metro.css" rel="stylesheet">
        <link href="css/metro-icons.css" rel="stylesheet">
        <link href="css/metro-responsive.css" rel="stylesheet">
        <link href="css/metro-schemes.css" rel="stylesheet">
        <link href="css/normalize.css" rel="stylesheet">
        <link href="css/rodmod.css" rel="stylesheet">
        <script src="js/jquery.min.js"></script>
        <script src="js/metro.js"></script>
        <script src="js/rodmod.js"></script>
        <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
        <script>
            function showDialog(id){
                var dialog = $("#"+id).data('dialog');
                if (!dialog.element.data('opened')) {
                    dialog.open();
                } else {
                    dialog.close();
                }
            }
            function check() {
                var e = document.getElementById('checkout');
                if (document.getElementById('checkbox')
                .checked == true) {
                    e.removeAttribute('disabled');
                }
                var e = document.getElementById('checkout');
                if (document.getElementById('checkbox')
                .checked == false) {
                    e.setAttribute('disabled', 'disabled');
                }
            }
            init();
        </script>
        <style>
            .table tbody td {padding: 0.625rem 0.5rem;}
            .accordion > .frame > .heading {padding: 8px 0 8px 20px;}
            .button {cursor: default;}
            fieldset {background: white;}
            fieldset:disabled {background: whitesmoke;}
            input:disabled {background: gainsboro;}
            input:disabled[value] {color: whitesmoke;}
        </style>
<?php
if (isset($_POST['submit'])) {
    $email = $_POST['email'];
    $email2 = $_POST['email2'];
    if ($email == $email2) {
        // Email korrekt.
       
        $message = <<<EOT
        Name: {$_POST['name']}
        Nachname: {$_POST['nname']}
        Email: {$_POST['email']}
        Betreff:  {$_POST['betreff']}
        Nachricht:  {$_POST['nachricht']}
        EOT;
        require "phpmailer/class.phpmailer.php"; //include phpmailer class
        include "phpmailer/class.smtp.php"; // optional, gets called from within class.phpmailer.php if not already loaded
        require 'phpmailer/language/phpmailer.lang-de.php'; // deutsche Fehlermeldungen
        // Instantiate Class
        $mail = new PHPMailer();
        // Set up SMTP
        $mail->IsSMTP();                // Sets up a SMTP connection
        $mail->SMTPAuth = true;         // Connection with the SMTP does require authorization
        $mail->SMTPSecure = "ssl";      // Connect using a TLS connection
        $mail->Host = "smtprelaypool.ispgateway.de";  // SMTP server address
        $mail->Port = 465;  //Gmail SMTP port
        $mail->Encoding = '8bit';
        // Authentication
                $mail->Username   = "[email protected]"; // Your full  address
                $mail->Password   = "xxx"; // Your  password
        // Compose
        $mail->CharSet = 'utf-8';
        $mail->SetFrom($_POST['email'], $_POST['name'] . " " . $_POST['nname']);
        $mail->AddReplyTo($_POST['email'], $_POST['name'] . " " . $_POST['nname']);
        $mail->Subject = ($_POST['betreff']);
        $mail->MsgHTML($message);
        $mail->AddAttachment('images/phpmailer.png');      // attachment
        $mail->AddAttachment('images/phpmailer_mini.png'); // attachment
        // Send To
                $mail->AddAddress("[email protected]", "xxx.de"); // Where to send it - Recipient
        $result = $mail->Send();    // Send!
        $message = $result ? '<div class="button warning">Nachricht wurde verschickt.</div>' : '<div class="button alert">Nachricht wurde nicht verschickt, versuchen Sie es später noch einmal.</div>';
        unset($mail);    } else {
        // Email nicht korrekt.
        $errEmail2 = 'E-Mail prüfen.';
     }
  }
?>
        </head>