Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
587
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. <?php
  2. //ini_set(‘display_errors’, 1);
  3.  
  4. include '/var/www/includes/mailer.php';
  5.  
  6. //require 'PHPMailerAutoload.php';
  7.  
  8. $mail = new PHPMailer;
  9.  
  10. $mail->SMTPDebug = 3; // Enable verbose debug output
  11.  
  12. $mail->isSMTP(); // Set mailer to use SMTP
  13. $mail->Host = 'smtp.nicetrygoyim.nl'; //Specify main and backup SMTP servers
  14. $mail->SMTPAuth = true; // Enable SMTP authentication
  15.  
  16.  
  17. $mail->Username = 'secret@secret.com'; // SMTP username
  18. $mail->Password = 'nicetry'; // SMTP password
  19. $mail->SMTPSecure = 'TLS'; // Enable TLS encryption, `ssl` also accepted
  20. $mail->Port = 587; // TCP port to connect to
  21.  
  22. $mail->setFrom('secret@secret.com', 'Mailer');
  23. $mail->addAddress('secret@secret.com', 'secret'); // Add a recipient
  24. $mail->addAddress('secret@secret.com', 'secret); // Name is optional
  25. //$mail->addReplyTo('secret@secret.com', 'Information');
  26. //$mail->addCC('cc@example.com');
  27. //$mail->addBCC('bcc@example.com');
  28.  
  29. //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
  30. //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
  31. $mail->isHTML(true); // Set email format to HTML
  32.  
  33. $mail->Subject = 'Here is the subject';
  34. $mail->Body = 'This is the HTML message body <b>in bold!</b>';
  35. $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
  36.  
  37.  
  38. $mail->smtpConnect([
  39. 'ssl' => [
  40. 'verify_peer' => false,
  41. 'verify_peer_name' => false,
  42. 'allow_self_signed' => true
  43. ]
  44. ]);
  45.  
  46. if(!$mail->send()) {
  47. echo 'Message could not be sent.';
  48. echo 'Mailer Error: ' . $mail->ErrorInfo;
  49. } else {
  50. echo 'Message has been sent';
  51. }
  52. ?>
  53.  
  54. <form action="mail.php" method="post">
  55. Leerlingnummer:<br>
  56. <input type="text" name="leerlingnummer"required placeholder="Voer hier het leerlingnummer in" /><br>
  57. E-mailadres:<br>
  58.  
  59. <input type="submit" name="submit" class="groottext" value="Reparatie indienen"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement