function _langReplaceHandler($m)
 {
     return getLangString($m[1], $this->_sLang);
 }
Beispiel #2
0
function sendRegistrationMail($userid)
{
    global $db;
    $user = pg_fetch_object(pg_query($db, "SELECT * FROM \"user\" WHERE id = " . $userid));
    if (is_object($user) && $user->isemail) {
        $header = "From: \"" . getLangString("MAIL_FROM", $user->languageid) . "\" <" . MAILADDR_FROM . ">\r\n";
        $header .= "MIME-Version: 1.0\r\n";
        $header .= "Content-Type: text/plain; charset=\"utf-8\"\r\n";
        $subject = getLangString("MAIL_SUBJECT", $user->languageid);
        $body = getLangString("MAIL_GREETING", $user->languageid);
        if ($user->firstname != '') {
            $body .= " " . $user->firstname;
        }
        if ($user->surname != '') {
            $body .= " " . $user->surname;
        }
        $body .= "!\r\n\r\n" . getLangString("MAIL_SENTENCE1", $user->languageid);
        $body .= "\r\n" . getLangString("MAIL_USERNAME", $user->languageid) . " \"" . $user->username . "\"";
        $body .= "\r\n" . getLangString("MAIL_PASSWORD", $user->languageid) . " \"" . $user->password . "\"";
        $body .= "\r\n\r\n" . getLangString("MAIL_FINAL", $user->languageid);
        if (!mail($user->username, $subject, $body, $header)) {
            echoError(19, $user->username);
            return false;
        }
    }
    return true;
}