Advertisement
Guest User

Untitled

a guest
Jun 1st, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. if(isset($_POST['btnVerstuur']))
  2. {
  3. $vriendnaam = $_POST['TxtNaam'];
  4. $naarEmail = $_POST['TxtEmail'];
  5. require 'PHPMailer/PHPMailerAutoload.php';
  6.  
  7. $mail = new PHPMailer;
  8.  
  9. //$mail->SMTPDebug = 3; // Enable verbose debug output
  10.  
  11. $mail->isSMTP(); // Set mailer to use SMTP
  12. $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
  13. $mail->SMTPAuth = true; // Enable SMTP authentication
  14. $mail->Username = 'commisie.feest@gmail.com'; // SMTP username
  15. $mail->Password = 'Zoomvliet17'; // SMTP password
  16. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  17. $mail->Port = 587; // TCP port to connect to
  18.  
  19. $mail->setFrom('commisie.feest@gmail.com', 'VSV-Consultency');
  20. $mail->addAddress($_POST['TxtEmail'], $_POST['TxtEmail']); // Name is optional
  21. $mail->addReplyTo('commisie.feest@gmail.com', 'Information');
  22. $mail->isHTML(true); // Set email format to HTML
  23.  
  24. $mail->Subject = 'VSV-Consultency';
  25. $mail->Body = 'Beste '.$vriendnaam.'
  26. <br/>
  27. <br/>
  28. Goededag je vriend heeft je uitgenodigd om deze web site te bezoeken
  29. <br/>
  30. <br/>
  31. http://localhost/IB1A/project4/vsvhome.php
  32. <br/>
  33. <br/>
  34. met vriendelijke groet
  35. <br/>
  36. <br/>
  37. <br/>
  38. De Feest Commissie!!';
  39. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  40.  
  41. if(!$mail->send()) {
  42. echo 'mail is nog niet verzonden.';
  43. echo 'Mailer Error: ' . $mail->ErrorInfo;
  44. } else {
  45. echo 'mail is verzonden';
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement