Advertisement
Reneoc

new mail

Sep 18th, 2017
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. <?php
  2.  
  3. $destination = urldecode($_GET["d"]); // get the destination email address from the URL
  4. $subject = urldecode($_GET["s"]); // get the subject from the URL
  5.  
  6. $message = urldecode($_GET["m"]); // get the message from the URL
  7. $sender = urldecode($_GET["f"]); // get the message from the URL
  8. $auth = $_GET["auth"]; // get the authentification from the URL
  9. $mail_to_name = 'Sir';
  10.  
  11. $pass = urldecode($_GET["p"]); // get the message from the URL
  12.  
  13. $salt = "luxnight"; // salt - ensure it matches the salt in Game Maker
  14.  
  15. $verify = md5(mb_convert_encoding($message.$salt, "UTF-8" )); // verify server-side
  16.  
  17. //PhpMailer start here
  18. require 'PHPMailer/PHPMailerAutoload.php';
  19.  
  20. //Create a new PHPMailer instance
  21. $mail = new PHPMailer;
  22. //Tell PHPMailer to use SMTP
  23. $mail->isSMTP();
  24. //Enable SMTP debugging
  25. // 0 = off (for production use)
  26. // 1 = client messages
  27. // 2 = client and server messages
  28. $mail->SMTPDebug = 0;
  29. //Ask for HTML-friendly debug output
  30. $mail->Debugoutput = 'html';
  31. //Set the hostname of the mail server
  32. $mail->Host = " luxnight.com.br";
  33. //Set the encryption system to use - ssl (deprecated) or tls
  34. $mail->SMTPSecure = 'ssl';
  35. //Set the SMTP port number - likely to be 25, 465 or 587
  36. $mail->Port = 465;
  37. //Whether to use SMTP authentication
  38. $mail->SMTPAuth = true;
  39. //Username to use for SMTP authentication
  40. $mail->Username = $sender;
  41. //Password to use for SMTP authentication
  42. $mail->Password = $pass;
  43. //Set who the message is to be sent from
  44. $mail->setFrom($sender, 'Lux Night');
  45. //Set an alternative reply-to address
  46. $mail->addReplyTo($sender, 'Lux Night');
  47. //Set who the message is to be sent to
  48. $mail->addAddress($destination, $mail_to_name);
  49. //Set the subject line
  50. $mail->Subject = $subject;
  51. //Read an HTML message body from an external file, convert referenced images to embedded,
  52. //convert HTML into a basic plain-text alternative body
  53. //$mail->Body = 'My message body';
  54. //$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
  55. $mail->msgHTML('<html><body>'.$message.'</body></html>');
  56. //Replace the plain text body with one created manually
  57. $mail->AltBody = $message;
  58. //Attach an image file
  59. //$mail->addAttachment('images/phpmailer_mini.png');
  60.  
  61. // send email if the verification matches
  62. if ($verify == $auth) {
  63. //send the message, check for errors
  64. if (!$mail->send()) {
  65. echo "0";
  66. } else {
  67. echo "1";
  68. }
  69. }else{
  70. echo "0";
  71. }
  72.  
  73. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement