Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once "Mail.php";
- $from = "<EMAIL@gmail.com>";
- $to = "<EMAIL@gmail.com>";
- $subject = "Report";
- $body = "Username: " . $_POST['username'] . ".";
- $host = "ssl://smtp.gmail.com";
- $port = "465";
- $username = "EMAIL@gmail.com";
- $password = "PASSWORD";
- $headers = array ('From' => $from,
- 'To' => $to,
- 'Subject' => $subject);
- $smtp = Mail::factory('smtp',
- array ('host' => $host,
- 'port' => $port,
- 'auth' => true,
- 'username' => $username,
- 'password' => $password));
- $mail = $smtp->send($to, $headers, $body);
- if (PEAR::isError($mail)) {
- echo("<p>" . $mail->getMessage() . "</p>");
- } else {
- 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>");
- }
- ?> <!-- end of php tag-->
- AND THE HTML FORM LOOKS LIKE THIS:
- <html lang="en">
- <head>
- <title>Report a player</title>
- </head>
- <body>
- <form name="input" action="report.php" method="get">
- Username: <input type="text" name="username" />
- Password: <input type="pwd" name="password" />
- Age: <input type="text" name="age" />
- <br>
- <input type="submit" value="Submit" />
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement