Exemple #1
0
}
if ($option == 'sendpwd') {
    if ($_POST['username'] != '' && $_POST['usermail'] != '') {
        $sql_login = $GETSQL->fSql("uid,userpwd,mail", "`{$ODBC['tablepre']}members`", "`username`='{$_POST['username']}' AND `mail`='{$_POST['usermail']}'", "", "", "", "U_B");
        if ($sql_login['uid'] != '') {
            $newpwd = md5(fHtmlcode());
            $GETSQL->fUpdate("`{$ODBC['tablepre']}members`", "`password`='{$newpwd}'", "`uid`='{$sql_login['uid']}'");
        }
        include_once Getincludefun("mail");
        //邮件发送
        $mail = new mail();
        $mail->setTo("*****@*****.**");
        //收件人
        //$mail->setCC("b@b.com,c@c.com"); //抄送
        //$mail->setCC("d@b.com,e@c.com"); //秘密抄送
        $mail->setFrom("*****@*****.**");
        //发件人
        $mail->setSubject("主题");
        //主题
        $mail->setText("文本格式");
        //发送文本格式也可以是变量
        $mail->setHTML("html格式");
        //发送html格式也可以是变量
        //$mail->setAttachments("c:a.jpg") ;//添加附件,需表明路径
        $mail->send();
        //发送邮件
        $mess = gb2utf8("请查收您的邮箱");
        die($mess);
    }
    include_once Getincludefun("html");
    $smarty->assign('config', array('title' => $config['title'] . "找回密码", 'keywords' => $config['keywords'] . "找回密码", 'description' => $config['description'] . "找回密码"));
Exemple #2
0
    }
}
if ($option == 'sendpwd') {
    if ($_POST['update'] == 'update') {
        include_once Getincludefun("mail");
        //常用函数
        $sql_members = $GETSQL->fSql("uid,username,useremail", "`{$ODBC['tablepre']}members`", "`username`='{$_POST['username']}'", "", "", "", "U_B");
        if ($sql_members['useremail'] == $_POST['usermail']) {
            $newpwd = fHtmlcode();
            $GETSQL->fUpdate("`{$ODBC['tablepre']}members`", "`userpwd`='{$newpwd}'", "`uid`='{$sql_members['uid']}'");
            $mail = new mail();
            $mail->mailTo = $sql_members['useremail'];
            $mail->mailFrom = $config['mail'];
            $mail->mailSubject = $config['webname'];
            $mail->mailText = "您在" . $config['webname'] . "的用户密码更新为:{$newpwd}";
            $mail->setTo($sql_members['useremail']);
            //收件人
            $mail->setFrom($config['mail']);
            //发件人
            $mail->setSubject($config['webname']);
            //主题
            $mail->setText("您在" . $config['webname'] . "的用户密码更新为:{$newpwd}");
            //发送文本格式也可以是变量
            $mail->send();
            //发送邮件
            die(gb2utf8("发送密码到你的邮箱成功,请到您的邮箱获取密码"));
        }
        die(gb2utf8("error 对不起您的邮箱地址不正确"));
    }
    $smarty->display("sendpwd.htm");
}