Advertisement
Guest User

senden.php

a guest
Jul 22nd, 2017
575
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.81 KB | None | 0 0
  1. <style type="text/css">
  2. body {text-align:center; }
  3. .error
  4. {
  5.     width: 300px;
  6.     height: 200px;
  7.     text-align: center;
  8.     position: absolute;
  9.     left: 50%;
  10.     top: 50%;
  11.     margin-left: -150px;
  12.     margin-top: -100px;
  13.     font-size: 32px;
  14.     font-variant: bold;
  15.     color: red;
  16.     font-family: Arial;
  17. }
  18. .erfolg
  19. {
  20.     width: 300px;
  21.     height: 200px;
  22.     text-align: center;
  23.     position: absolute;
  24.     left: 50%;
  25.     top: 50%;
  26.     margin-left: -150px;
  27.     margin-top: -100px;
  28.     font-size: 32px;
  29.     font-variant: bold;
  30.     color: green;
  31.     font-family: Arial;
  32. }
  33. </style>
  34. <?php
  35. if ($_GET['name'] <> "" & $_GET['Klasse'] <> "" & $_GET['LvL'] <> "" & $_GET['Gearscore'] <> "" & $_GET['jn'] <> "")
  36. {
  37. $ich = $_GET['name'];
  38. require 'PHPMailerAutoload.php';
  39.  
  40. $mail = new PHPMailer;
  41.  
  42. //$mail->SMTPDebug = 3;                               // Enable verbose debug output
  43.  
  44. $mail->isSMTP();                                      // Set mailer to use SMTP
  45. $mail->Host = 'send.one.com';  // Specify main and backup SMTP servers
  46. $mail->SMTPAuth = true;                               // Enable SMTP authentication
  47. $mail->Username = 'email@example.de';                 // SMTP username
  48. $mail->Password = 'secret';                           // SMTP password
  49. $mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
  50. $mail->Port = 587;                                    // TCP port to connect to
  51.  
  52. $mail->setLanguage('de', 'languages/'); // To load the German version
  53.  
  54. $mail->setFrom('email@example.de', 'Nodewar Anmeldung');
  55. //$mail->addAddress('email@example.de', 'Joe User');     // Add a recipient
  56. $mail->addAddress('email@example.de');               // Name is optional
  57. //$mail->addReplyTo('email@example.de', 'Information');
  58. $mail->addReplyTo('email@example.de');
  59. //$mail->addCC('cc@example.com');
  60. //$mail->addBCC('bcc@example.com');
  61.  
  62. //$mail->addAttachment('/var/tmp/file.tar.gz');         // Add attachments
  63. //$mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
  64. $mail->isHTML(true);                                  // Set email format to HTML
  65.  
  66. $mail->Subject = 'Newsletter Anmeldung';
  67. $mail->Body    = nl2br($_GET["name"]).'<br>Klasse: '.$_GET["Klasse"].'<br>Level: '.$_GET["LvL"].'<br>Gearscore: '.$_GET["Gearscore"].'<br>Macht mit: '.$_GET["jn"];
  68. $mail->AltBody = 'Bitte einen anderen Browser oder Email-Client benutzen !';
  69.  
  70. if(!$mail->send()) {
  71.     echo 'Fehler beim Versenden !';
  72.     echo 'Mailer Error: ' . $mail->ErrorInfo;
  73. } else {
  74.     echo '<div class="erfolg">Vielen Danke für die Anmeldung !</br><meta http-equiv="refresh" content="5; URL=https://www.google.de"></div>';
  75. }
  76. }
  77. else
  78. {
  79.     echo "<div class='error'>Es wurden nicht alles Felder ausgefüllt, bitte erneut versuchen ! </br><a href='index.html'>Zurück</a></div>";
  80. }
  81.  
  82. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement