require "include/bittorrent.php"; dbconn(); $id = (int) $_GET["id"]; if (!$id) stderr( _("Error"), "Bad or missing ID."); $res = do_mysql_query("SELECT username, class, email FROM users WHERE id=$id"); $arr = mysql_fetch_assoc($res) or stderr( _("Error"), "No such user."); $username = $arr["username"]; if ($arr["class"] < UC_MODERATOR) stderr( _("Error"), "The gateway can only be used to e-mail staff members."); if ($_SERVER["REQUEST_METHOD"] == "POST") { $to = $arr["email"]; $from = substr(trim($_POST["from"]), 0, 80); if ($from == "") $from = "Anonymous"; $from_email = substr(trim($_POST["from_email"]), 0, 80); if ($from_email == "") $from_email = "noreply@torrentbits.org"; $from = "$from <$from_email>"; $subject = substr(trim($_POST["subject"]), 0, 80); if ($subject == "") $subject = "(No subject)"; $subject = "Fw: $subject"; $message = trim($_POST["message"]); if ($message == "") stderr( _("Error"), "No message text!"); $message = "Message submitted from $_SERVER[REMOTE_ADDR] at " . gmdate("Y-m-d H:i:s") . " GMT.\n" . "Note: By replying to this e-mail you will reveal your e-mail address.\n" . "---------------------------------------------------------------------\n\n" . $message . "\n\n" . "---------------------------------------------------------------------\n$SITENAME E-Mail Gateway\n"; $success = mail($to, $subject, $message, "From: $from", "-f$SITEEMAIL"); if ($success) stderr("Success", "E-mail successfully queued for delivery."); else stderr( _("Error"), "The mail could not be sent. Please try again later."); } stdhead("E-mail gateway"); ?>
/email.gif> | Send e-mail to =$username;?> |
Note: Your IP-address will be logged and visible to the recipient to prevent abuse.
Make sure to supply a valid e-mail address if you expect a reply.