<!--#include file=conn.asp-->
<!--#include file=../md5.asp-->
<!--#include file=../mail.asp-->
<!--#include file=../config.asp-->
<%
dim rs,sql,username,email
username=request("username")
email=request("email")
set rs=server.createobject("adodb.recordset")
sql="select username,password,email from [user] where username='"&username&"' or email='"&email&"'"
rs.open sql,conn,1,3
if rs.eof or rs.bof then
rs.addnew
rs("username")=username
rs("password")=md5(username)
rs("email")=email
rs.update
response.write "<li>添加用户成功！"
call mail()
else
 if rs("username")=""&username&"" then
 response.write "<li>用户名已经存在！"
 response.end
 end if
 if rs("email")=""&email&"" then
 response.write "<li>邮件地址已经存在！"
 response.end
 end if
end if
sub mail()
dim mailbody,Jmail
mailbody="你的登陆帐号："&username&" <br>你的登陆密码："&username&"<br><br>登陆地址为：<a target=_blank href="&web&">"&web&"</a><br><br>登陆成功后请先修改你的资料，否则不能发布二手信息"
Set Jmail=server.createobject("Jmail.Message")
Jmail.Charset ="gb2312"
Jmail.Silent =true
JMail.ContentType = "text/html"
Jmail.Priority = 3
Jmail.MailServerUserName = mailname
Jmail.MailServerPassword = mailpass
Jmail.From = mailform
Jmail.FromName ="二手管理员"
Jmail.Subject ="恭喜你注册成功，请查收登陆帐号！"
Jmail.AddRecipient ""&email&""
Jmail.Body = mailbody
Jmail.Send(mailsmtp)
Set Jmail=nothing
end sub
%>