Guest User

Untitled

a guest
Oct 16th, 2016
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <?php
  2. include("phpmailer/class.phpmailer.php");
  3. if ( isset($_POST["send"]) )
  4. {
  5.  
  6.  
  7.  
  8. $to = $_POST['to'];
  9. $subject = $_POST['subject'];
  10. $sender = $_POST['sender'];
  11. $website = $_POST['website'];
  12. $template = empty($_POST['template']) ? null : $_POST['template'];
  13. $sendername = $_POST['sendername'];
  14.  
  15. if ( empty($template) )
  16. die('Missing template.');
  17.  
  18. $template = file_get_contents('./Templates/'.$template.'.html');
  19. $template = str_replace('%%LINK%%', $website, $template);
  20. $mail = new PHPMailer();
  21. $mail->IsSMTP();
  22. $mail->CharSet = 'UTF-8';
  23. $mail->Host = "smtp.gmail.com";
  24. $mail->SMTPAuth= true;
  25. $mail->Port = 587; // Or Port 465 if with out TLS
  26. $mail->Username= "EMAILHERE!";
  27. $mail->Password= "notallowed";
  28. $mail->SMTPSecure = 'ssl';
  29. $mail->send();
  30. $headers .= "X-Priority: 1 (Highest)\n";
  31. $headers .= "X-MSMail-Priority: High\n";
  32. $headers .= "Importance: High\n";
  33. $headers = "MIME-Version: 1.0" . "\r\n";
  34. $headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
  35. //mail( $to, $subject,$mail, $template, $headers);
  36. if(!$mail->send()){
  37. echo "<script>alert('Mail sent!'); </script>";
  38. }
Add Comment
Please, Sign In to add comment