Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $from = "Emerick <emerick@live.be>";
- $to = "Emerick <emerick@live.be>";
- $subject = "Mail from my website";
- $host = "smtp-mail.outlook.com";
- $username = "emerick@live.be";
- $password = "my password";
- $headers = array ('From' => $from,
- 'To' => $to,
- 'Subject' => $subject);
- $smtp = Mail::factory('smtp',
- array ('host' => $host,
- 'auth' => true,
- 'username' => $username,
- 'password' => $password));
- $mail = $smtp->send($to, $headers, $body);
- if (PEAR::isError($mail)) {
- echo("<p>" . $mail->getMessage() . "</p>");
- } else {
- echo("<p>Message successfully sent!</p>");
- }
- if(isset($_POST['email'])) {
- function died($error) {
- // your error code can go here
- echo "Iets liep fout bij het versturen. ";
- echo "De fout(en) staan hier onder:<br /><br />";
- echo $error."<br /><br />";
- echo "Ga terug om dit op te lossen.<br /><br />";
- die();
- }
- // validation expected data exists
- if(!isset($_POST['name']) ||
- !isset($_POST['email']) ||
- !isset($_POST['comment'])) {
- died('We are sorry, but there appears to be a problem with the form you submitted.');
- }
- $name = $_POST['name']; // required
- $email = $_POST['email']; // required
- $comment = $_POST['comment']; // required
- $error_message = "";
- $string_exp = "/^[A-Za-z .'-]+$/";
- if(!preg_match($string_exp,$name)) {
- $error_message .= 'De naam dat u ingegeven hebt is niet correct.<br />';
- }
- if(strlen($comment) < 2) {
- $error_message .= 'Het bericht dat u proberen in te geven hebt is niet correct.<br />';
- }
- if(strlen($error_message) > 0) {
- died($error_message);
- }
- $email_message = "Details:nn";
- function clean_string($string) {
- $bad = array("content-type","bcc:","to:","cc:","href");
- return str_replace($bad,"",$string);
- }
- $email_message .= "Naam: ".clean_string($name)."n";
- $email_message .= "E-mail: ".clean_string($email)."n";
- $email_message .= "Bericht: ".clean_string($comment)."n";
- // create email headers
- $headers = 'From: '.$email."rn".
- 'Reply-To: '.$email."rn" .
- 'X-Mailer: PHP/' . phpversion();
- @mail($email_to, $email_subject, $email_message, $headers);
- ?>
- <!DOCTYPE html>
- <html>
- <title>AsmusToday</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato">
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css">
- <link rel="icon" href="logo.png">
- <style>
- body,h1,h2,h3,h4,h5,h6 {font-family: "Lato", sans-serif;}
- body, html {
- height: 100%;
- color: #777;
- line-height: 1.8;
- }
- /* Create a Parallax Effect */
- .bgimg-1 {
- { background-attachment: fixed; background-position: center; background-repeat: no-repeat; background-size: cover; }
- /* First image (Logo. Full height) */
- .bgimg-1 { background-image: url('skyline.jpeg'); min-height: 100%; }
- .w3-wide {letter-spacing: 10px;}
- .w3-hover-opacity {cursor: pointer;}
- /* Turn off parallax scrolling for tablets and mobiles */
- @media only screen and (max-width: 1024px) {
- .bgimg-1 {
- background-attachment: scroll;
- }
- }
- /* Ads style on the text of the page */
- .square {
- background-color:#000!important;
- padding: 12px;
- margin-left: 150px;
- margin-right: 150px;
- }
- </style>
- <body>
- <!-- Refreshes the page after 5 sec. to the homepage -->
- <meta http-equiv="refresh" content="5;URL= http://asmus.ga">
- <!-- Parallax Image with Text -->
- <div class="bgimg-1 w3-opacity w3-display-container">
- <div class="w3-display-middle" style="white-space:nowrap;">
- <span class="w3-center w3-padding-xlarge w3-black w3-xlarge w3-wide w3-animate-opacity" style="border-radius: 5px;">Bedankt!</span>
- </div>
- </div>
- </body>
- </html>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement