⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lw.asp

📁 这是一个文章管理的网页源程序
💻 ASP
字号:
<!--#include file="conn.asp"-->
<html>
<head>
<title>找回密码</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="images/new.css">
</head>

<body bgcolor="#FFFFFF">
<%
	dim rs,sql
	dim boardtype
    	dim foundErr 
    	dim ErrMsg
	dim topic
	dim mailbody
	dim email
	
   	set rs=server.createobject("adodb.recordset")
    	if foundErr then
		call Error()
	else
		call showPage()
	end if

	sub showPage()
		'on error resume next
		if foundErr then
			call Error()
		else
			if request("action")="sendmail" then
				if IsValidEmail(trim(Request.Form("mail")))=false then
   					errmsg=errmsg+"<br>"+"<li>您的Email有错误!</li>"
   					founderr=true
				else
					email=trim(Request.Form("mail"))
				end if
				call announceinfo()
				if founderr then
					call Error()
				else
					call jmail(email)
					call success()
				end if
			else
				call pag()
			end if
		end if
		if err.number<>0 then err.clear
	end sub

	sub announceinfo()
	topic="发来密码"
	mailbody=mailbody &"<style>A:visited {	TEXT-DECORATION: none	}"
	mailbody=mailbody &"A:active  {	TEXT-DECORATION: none	}"
	mailbody=mailbody &"A:hover   {	TEXT-DECORATION: underline overline	}"
	mailbody=mailbody &"A:link 	  {	text-decoration: none;}"
	mailbody=mailbody &"A:visited {	text-decoration: none;}"
	mailbody=mailbody &"A:active  {	TEXT-DECORATION: none;}"
	mailbody=mailbody &"A:hover   {	TEXT-DECORATION: underline overline}"
	mailbody=mailbody &"BODY   {	FONT-FAMILY: 宋体; FONT-SIZE: 9pt;}"
	mailbody=mailbody &"TD	   {	FONT-FAMILY: 宋体; FONT-SIZE: 9pt	}</style>"

	Rs.open "Select username,password from admin where email="&email&"",conn,1,1

	announce=announce &"<TABLE border=0 width='95%' align=center><TBODY><TR>"
	announce=announce &"<TD valign=middle align=top>"
	announce=announce &"--&nbsp;&nbsp;作者:"&rs("username")&"<br>"
	announce=announce &"--&nbsp;&nbsp;发布时间:"&rs("password")&"<br><br>"
	announce=announce &"--&nbsp;&nbsp;请保管好您的密码!<br>"
	announce=announce &"--&nbsp;&nbsp;谢谢合作!:)"
	announce=announce &"<hr></TD></TR></TBODY></TABLE>"

	rs.close
	mailbody=mailbody+announce
	mailbody=mailbody &"<center><a href=http://www.120idea.com>120医学经典</a>"
'	response.write mailbody
'	mailbody=""
'	response.end
	end sub

	sub pag()
%> 
<table cellpadding=0 cellspacing=0 border=0 width=460 bgcolor=#777777 align=center>
  <tr> 
    <td> 
      <table cellpadding=6 cellspacing=1 border=0 width=100%>
        <form action="lw.asp?action=sendmail" method=post>
          <tr bgcolor="#EEEEEE"> 
            <td colspan=2 align=center> <b>发送给好友</b></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td valign=middle colspan=2> <b>把本文打包邮递。</b><br>
              请正确输入你要邮递的邮件地址! </td>
          </tr>
          <tr> 
            <td bgcolor=#EEEEEE><b>邮递的 Email 地址:</b></td>
            <td bgcolor=#EEEEEE> 
              <input type=text size=40 name="mail" class="myin1">
            </td>
          </tr>
          <tr> 
            <td colspan=2 bgcolor=#EEEEEE align=center>
              <input type=submit value="发 送" name="Submit">
        </form>
      </table>
    </td>
  </tr>
</table>
<%
	end sub

	sub success()
%> 
<table cellpadding=0 cellspacing=0 border=0 width=460 bgcolor=#777777 align=center>
  <tr> 
    <td> 
      <table cellpadding=3 cellspacing=1 border=0 width=100%>
        <tr align="center"> 
          <td width="100%" bgcolor=#EEEEEE>发送成功</td>
        </tr>
        <tr> 
          <td width="100%" bgcolor=#FFFFFF>恭喜您,您的密码已经发送到您的邮箱当中,请查收。 </td>
        </tr>
        <tr align="center"> 
          <td width="100%" bgcolor=#EEEEEE> <a href="../index.asp"> 
            返回首页</a> </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<%
end sub

sub error()
%><br>
<table cellpadding=0 cellspacing=0 border=0 width=95% bgcolor=#777777 align=center>
  <tr> 
    <td> 
      <table cellpadding=3 cellspacing=1 border=0 width=100%>
        <tr align="center"> 
          <td width="100%" bgcolor=#EEEEEE>发送邮件错误信息</td>
        </tr>
        <tr> 
          <td width="100%" bgcolor=#FFFFFF><b>产生错误的可能原因:</b><br>
            <br>
            <%=errmsg%> </td>
        </tr>
        <tr align="center"> 
          <td width="100%" bgcolor=#EEEEEE> <a href="javascript:history.go(-1)"> 
            << 返回上一页</a> </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<%
end sub

	sub Jmail(email)
	on error resume next
	Dim JMail,SendMail
	Set JMail=Server.CreateObject("JMail.SMTPMail")
	JMail.Logging=True
	JMail.Charset="gb2312"
	JMail.ContentType = "text/html"
	JMail.ServerAddress="smtp.120idea.com"
	JMail.Sender="webmaster@120idea.com"
	JMail.Subject=topic
	JMail.Body=mailbody
	JMail.AddRecipient email
	JMail.Priority=3
	JMail.Execute 
	Set JMail=nothing 
	if err then 
	SendMail=err.description
	err.clear
	else
	SendMail="OK"
	end if
	end sub

function IsValidEmail(email)

dim names, name, i, c

'Check for valid syntax in an email address.

IsValidEmail = true
names = Split(email, "@")
if UBound(names) <> 1 then
   IsValidEmail = false
   exit function
end if
for each name in names
   if Len(name) <= 0 then
     IsValidEmail = false
     exit function
   end if
   for i = 1 to Len(name)
     c = Lcase(Mid(name, i, 1))
     if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then
       IsValidEmail = false
       exit function
     end if
   next
   if Left(name, 1) = "." or Right(name, 1) = "." then
      IsValidEmail = false
      exit function
   end if
next
if InStr(names(1), ".") <= 0 then
   IsValidEmail = false
   exit function
end if
i = Len(names(1)) - InStrRev(names(1), ".")
if i <> 2 and i <> 3 then
   IsValidEmail = false
   exit function
end if
if InStr(email, "..") > 0 then
   IsValidEmail = false
end if

end function
	set rs=nothing
	conn.close
	set conn=nothing
%> 
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -