Advertisement
AndreasEnemyr

Untitled

Nov 30th, 2017
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.90 KB | None | 0 0
  1. <?php
  2.     //Rör ej!
  3.     header('Content-type: charset=utf-8');
  4.     require 'phpmailer/PHPMailerAutoload.php';
  5.     $mail = new PHPMailer();
  6.     $mail->isHTML(true);
  7.     $mail->isSMTP();
  8.     $mail->SMTPDebug = 2;
  9.     $mail->SMTPAuth = true;
  10.     $mail->SMTPSecure = "ssl";
  11.     $mail->Port = 465;
  12.     $encoding="UTF-8";
  13.        
  14.     //Rör här
  15.     $mail->Host = "smtp.gmail.com";
  16.     $mail->Username = "andreas.enemyr@gmail.com";
  17.     $mail->Password = "";
  18.  
  19.     $mail->setFrom('andreas.enemyr@gmail.com','Kött på riktigt');
  20.  
  21.     $mail->Subject = "Leveransbekräftelse";
  22.     $mail->Body = "Hej " + $_POST["namn"] + "! <br> Er låda " + $_POST["loda"] + " kommer att levereras den " + $_POST["datum"] + " klockan " + $_POST["tid"] + "! <br><br>Mvh Kött på riktigt!";
  23.     $mail->addAddress('' + $_POST['mail'] + '');
  24.  
  25.     //Rör ej!
  26.     if ($mail->send())
  27.         echo "Skickat!";
  28.     else
  29.         echo $mail->ErrorInfo;
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement