fallback safe value added */ function sendInvite($email, $uid, $text) { $subject = SERVER_NAME . " registration"; // FIX: prevent undefined variable notice $username = "User"; $message = "Hello " . $username . "\n\n" . "Try the new " . SERVER_NAME . "!\n\n\n" . "Link: " . SERVER . "anmelden.php?id=ref" . $uid . "\n\n" . $text . "\n\n\n" . "Greetings,\n" . "Travian"; $headers = "From: " . ADMIN_EMAIL . "\r\n"; @mail($email, $subject, $message, $headers); } /** * ------------------------------------------------------------------------- * SEND PASSWORD RESET EMAIL * ------------------------------------------------------------------------- */ function sendPassword($email, $uid, $username, $npw, $cpw) { $subject = "Password forgotten"; $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost'; $message = "Hello " . $username . "\n\n" . "You have requested a new password for Travian.\n\n" . "----------------------------\n" . "Name: " . $username . "\n" . "Password: " . $npw . "\n" . "----------------------------\n\n" . "Please click this link to activate your new password. The old password then becomes invalid:\n\n" . "http://" . $host . "/password.php?cpw=" . $cpw . "&npw=" . $uid . "\n\n" . "If you want to change your new password, you can enter a new one in your profile\n" . "on tab \"account\".\n\n" . "In case you did not request a new password you may ignore this email.\n\n" . "Travian"; $headers = "From: " . ADMIN_EMAIL . "\r\n"; @mail($email, $subject, $message, $headers); } } /** * ------------------------------------------------------------------------- * GLOBAL INSTANCE (legacy compatibility) * ------------------------------------------------------------------------- */ $mailer = new Mailer(); ?>