江苏蓝精灵装饰城:高手请进!!非常急!

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/27 19:04:57
请高手看看下面这段代码有什么错误?注册时不会出现成功页面,不能运行其中的发送邮件代码和成功代码!谢谢!!

....
set rs=server.CreateObject("adodb.recordset")
rs.Open "select mailaddress,mailusername,mailuserpass,mailname,mailsend from shop_config",conn,1,1
mailaddress=rs("mailaddress")
mailusername=rs("mailusername")
mailuserpass=rs("mailuserpass")
mailname=rs("mailname")
mailsend=rs("mailsend")
rs.close
set rs=nothing

'发送邮件
'if Forum_Setting(47)=1 then
on error resume next
'发送注册邮件
topic="您在" & webname & "的注册资料"
getpass=trim(request("userpassword"))

mailbody="<html>"
mailbody=mailbody & "<title>注册信息</title>"
mailbody=mailbody & "<body>"
mailbody=mailbody & "<TABLE border=0 width='95%' align=center><TBODY><TR>"
mailbody=mailbody & "<TD valign=middle align=top>"
mailbody=mailbody & trim(request("username"))&",您好:<br><br>"
mailbody=mailbody & "欢迎您注册" & webname & "网上商城,我们将提供给您最好的服务!<br>"
mailbody=mailbody & "下面是您在" & webname & "网上商城的注册信息:<br><br>"
mailbody=mailbody & "注册名:"&trim(request("username"))&"<br>"
mailbody=mailbody & "密 码:"&getpass&"<br>"
mailbody=mailbody & "<br><br>"
mailbody=mailbody & "<center><font color=red>再次感谢您注册" & webname & "网上商城!</font>"
mailbody=mailbody & "</TD></TR></TBODY></TABLE><br><hr width=95% size=1>"
mailbody=mailbody & "</body>"
mailbody=mailbody & "</html>"

Set JMail=Server.CreateObject("JMail.Message")
JMail.Charset="gb2312"
JMail.ContentType = "text/html"
jmail.from = mailsend
jmail.silent = true
jmail.Logging = true
jmail.FromName = mailname
jmail.mailserverusername = mailusername
jmail.mailserverpassword = mailuserpass
jmail.AddRecipient trim(request("useremail"))
jmail.body=mailbody
JMail.Subject=topic
if not jmail.Send ( mailaddress ) then
SendMail=""
else
SendMail="OK"
end if
if SendMail="OK" then
sendmsg="<p>· 您的注册信息已经发往您的邮箱,请注意查收!</p>"
else
sendmsg="<p>· 系统出错,注册信息资料未能发送到您的邮箱!</p>"
end if
'response.write mailbody
'end if

response.Write "<table width=760 align=center border=0 cellspacing=0 cellpadding=0 class=table-zuoyou bordercolor=#CCCCCC><tr><td bordercolor=#FFFFFF bgcolor=#FFFFFF align=center> "
response.Write "<table width=450 border=0 align=center cellpadding=0 cellspacing=0><tr><td height=260>"
response.Write "<p>· <font color=red>用户注册成功!</font></p><p>· 恭喜您注册成为 ["&webname&"] 的正式用户,请记好您的用户名及密码!</p>"
response.Write "<p>· <a href=index.asp>返回首页</a></p></td></tr></table></td></tr></table>"
....

你用rs.Open "select mailaddress,mailusername,mailuserpass,mailname,mailsend from shop_config",conn,1,1 打开,数据库是只读的,所以就出错了,后面的语句都没有执行,但你又指定了on error resume next,所以错误没有显示出来被忽略了。改成rs.Open "...",conn,3,3吧