Advertisement
Guest User

Untitled

a guest
Oct 6th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. <?php
  2.  
  3. require_once "Mail.php";
  4.  
  5. $from = "<EMAIL@gmail.com>";
  6. $to = "<EMAIL@gmail.com>";
  7. $subject = "Report";
  8. $body = "Username: " . $_POST['username'] . ".";
  9. $host = "ssl://smtp.gmail.com";
  10. $port = "465";
  11.  
  12. $username = "EMAIL@gmail.com";
  13. $password = "PASSWORD";
  14.  
  15. $headers = array ('From' => $from,
  16. 'To' => $to,
  17. 'Subject' => $subject);
  18. $smtp = Mail::factory('smtp',
  19. array ('host' => $host,
  20. 'port' => $port,
  21. 'auth' => true,
  22. 'username' => $username,
  23. 'password' => $password));
  24.  
  25. $mail = $smtp->send($to, $headers, $body);
  26.  
  27. if (PEAR::isError($mail)) {
  28. echo("<p>" . $mail->getMessage() . "</p>");
  29. } else {
  30. echo("<p>Thank you for sending us that report. Please do not send too many or your IP address will be blocked from our website.</p>");
  31. }
  32.  
  33. ?> <!-- end of php tag-->
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40. AND THE HTML FORM LOOKS LIKE THIS:
  41.  
  42.  
  43.  
  44. <html lang="en">
  45. <head>
  46. <title>Report a player</title>
  47. </head>
  48. <body>
  49. <form name="input" action="report.php" method="get">
  50. Username: <input type="text" name="username" />
  51. Password: <input type="pwd" name="password" />
  52. Age: <input type="text" name="age" />
  53. <br>
  54. <input type="submit" value="Submit" />
  55. </form>
  56. </body>
  57.  
  58. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement