예제 #1
0
파일: signup.php 프로젝트: humor-zo/chaofan
        $rs = $conn->execute($sql);
        $email_subject = str_replace('{$site_name}', $config['site_name'], $rs->fields['email_subject']);
        $email_path = $config['BASE_DIR'] . '/templates/' . $rs->fields['email_path'];
        $smarty->assign('username', $username);
        $smarty->assign('password', $password_clear);
        $smarty->assign('uid', $uid);
        $smarty->assign('code', $code);
        $body = $smarty->fetch($email_path);
        $mail = new VMail();
        $mail->setNoReply();
        $mail->Subject = $email_subject;
        $mail->AltBody = $body;
        $mail->Body = nl2br($body);
        $mail->AddAddress($email);
        $mail->Send();
        $mail->ClearAddresses();
        $sql = "SELECT email_subject, email_path FROM emailinfo\n                           WHERE email_id = 'welcome' LIMIT 1";
        $rs = $conn->execute($sql);
        $email_subject = str_replace('{$site_title}', $config['site_title'], $rs->fields['email_subject']);
        $email_path = $rs->fields['email_path'];
        $body = $smarty->fetch($config['BASE_DIR'] . '/templates/' . $email_path);
        $mail->Subject = $email_subject;
        $mail->AltBody = $body;
        $mail->Body = nl2br($body);
        $mail->AddAddress($email);
        $mail->Send();
        $_SESSION['message'] = $lang['signup.msg'];
        VRedirect::go($config['BASE_URL']);
    }
}
$smarty->assign('errors', $errors);